Changeset 441
- Timestamp:
- Jul 18, 2009, 2:55:15 AM (15 years ago)
- Location:
- Daodan/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/Daodan_BSL.c
r440 r441 3 3 #include "Daodan_BSL.h" 4 4 #include "BFW_ScriptingLanguage.h" 5 5 #include <stdio.h> 6 #include "Oni.h" 7 #include "Oni_Character.h" 6 8 #include "dSFMT\dSFMT.h" 7 9 … … 14 16 return 0; 15 17 } 18 19 uint16_t ONICALL bsl_getkills(void* dontuse0, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret) 20 { 21 22 //void* GS = (short int**)(ONgGameState); 23 24 //if (numargs < 2) 25 // return 1; 26 27 //fix the AC struct :( 28 //ret->value_int32 = ((ActiveCharacter *)(ONgGameState+0xB6268))->NumberOfKills; 29 //short int index =; 30 //char temp_bitset[2]; 31 int index2; 32 if (numargs == 0) index2 = 0; 33 else index2 = args[0].value_int32; 34 char* active_index = ONgGameState + index2 * 0x16A0 + 0x1260 + 2; 35 //index = *(*()+ 0x1260 +2); 36 //ret->value_int32 = *((signed int*)(ONgGameState)) +0xB6268+(*(((signed int*)(ONgGameState)) + 0xAC)+2)*0x2838+0x1670; 37 //ret->value_int32 = *(int*)(ONgGameState +0xB6268 + index2 * 0x2838 + 0x1670); 38 39 //TODO: Clean up this mess... 40 // ret->value_int32 = *active_index; 41 42 ret->value_int32 = ((uint32_t*)(ONgGameState +0xB6268+(int)(*active_index)*0x2838+0x1670)); 43 44 ret->type = sl_int32; 45 return 0; 46 } 47 16 48 17 49 uint16_t ONICALL bsl_mul(void* dontuse0, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret) … … 69 101 return 0; 70 102 } 103 uint16_t ONICALL bsl_sprintf(void* dontuse0, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret) 104 { 105 if (numargs < 2) 106 return 1; 107 108 109 <<<<<<< .mine 110 char output[255]; 111 char temp[255]; 112 int i = 1; 113 for(i; i < numargs; i++) { 114 sprintf(output, args[0].value_str32, args[i].value_str32);/* 115 if(args[i].type == sl_int32 || args[i].type == sl_bool) { 116 sprintf(temp, "%i",args[i].value_int32); 117 sprintf(output, args[0].value_str32, temp); } 118 else if(args[i].type == sl_float) { 119 sprintf(temp, "%f",args[i].value_float); 120 sprintf(output, args[0].value_str32, temp); } 121 else */ 122 } 123 124 ret->value_str32 = output; 125 ret->type = sl_str32; 126 return 0; 127 } 128 71 129 72 130 uint16_t ONICALL bsl_int32rand(void* dontuse0, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret) … … 96 154 } 97 155 156 98 157 void SLrDaodan_Initalize() 99 158 { … … 103 162 SLrScript_Command_Register_ReturnType("int32div", "Divides two numbers", "n1:int n2:int", sl_int32, bsl_int32div); 104 163 SLrScript_Command_Register_ReturnType("div", "Divides two numbers", "[int1:int|float1:float] [int2:int|float2:float]", sl_float, bsl_div); 164 165 166 SLrScript_Command_Register_ReturnType("sprintf", "sprintf", "str1:format str2:value [str3:...]", sl_str32, bsl_sprintf); 167 168 SLrScript_Command_Register_ReturnType("getkills","Gets the number of kills", "[n1:int]", sl_int32, bsl_getkills); 169 105 170 106 171 dsfmt_gv_init_gen_rand((uint32_t)time(NULL)); 107 172 SLrScript_Command_Register_ReturnType("int32rand", "Returns a pseudo-random number between two numbers (inclusive).", "start:int end:int", sl_int32, bsl_int32rand); 173 >>>>>>> .r440 108 174 } -
Daodan/src/Oni_Character.h
r438 r441 536 536 }; 537 537 538 539 int chr_isplayer = 0x00000001;//is player character540 int chr_randomskin = 0x00000002;//gets random skin from ONCV541 int chr_notprespawned = 0x00000004;//isn't spawned at level creation542 int chr_noncombatant = 0x00000008;//doesn't fight543 int chr_multispawnable = 0x00000010;//can spawn up to 5 without forcing544 int chr_unknown = 0x00000020;//545 int chr_unkillable = 0x00000040;//can only be brought to 1 hp546 int chr_superammo = 0x00000080;//infinite ammo547 int chr_omniscient = 0x00000100;//touchofdeath548 int chr_haslsi = 0x00000200;//drops an lsi549 int chr_boss = 0x00000400;//is a boss character550 int chr_upgradedifficulty = 0x00000800;//upgrade the difficulty if you play on med\hard551 int chr_noautodrop = 0x00001000;//uses drop fields instead of has fields on death552 538 enum { 539 chr_isplayer = 0x00000001, //is player character 540 chr_randomskin = 0x00000002, //gets random skin from ONCV 541 chr_notprespawned = 0x00000004, //isn't spawned at level creation 542 chr_noncombatant = 0x00000008, //doesn't fight 543 chr_multispawnable = 0x00000010, //can spawn up to 5 without forcing 544 chr_unknown = 0x00000020, // 545 chr_unkillable = 0x00000040, //can only be brought to 1 hp 546 chr_superammo = 0x00000080, //infinite ammo 547 chr_omniscient = 0x00000100, //touchofdeath 548 chr_haslsi = 0x00000200, //drops an lsi 549 chr_boss = 0x00000400, //is a boss character 550 chr_upgradedifficulty = 0x00000800, //upgrade the difficulty if you play on med\hard 551 chr_noautodrop = 0x00001000, //uses drop fields instead of has fields on death 552 }; // 553 553 int16_t ONICALL ONrGameState_NewCharacter(CharacterObject* CHAR, void* AISA, void* flag, int* list_location); 554 554 //int16_t ONICALL ONrGameState_GetPlayerCharacter();
Note:
See TracChangeset
for help on using the changeset viewer.