| 12 |
|
|
| 13 |
|
#include "Character.h" |
| 14 |
|
|
| 15 |
+ |
bool ONICALL argumentEmpty(sl_arg* arg) { |
| 16 |
+ |
if ((arg->type == sl_str32) && (strlen(arg->val.value_str32) == 0)) |
| 17 |
+ |
return true; |
| 18 |
+ |
return false; |
| 19 |
+ |
} |
| 20 |
|
|
| 21 |
|
uint16_t ONICALL bsl_int32mul(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) |
| 22 |
|
{ |
| 97 |
|
uint16_t ONICALL bsl_getkills(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) |
| 98 |
|
{ |
| 99 |
|
int index; |
| 100 |
< |
if (numargs == 0) index = 0; |
| 100 |
> |
if (argumentEmpty(&args[0])) index = 0; |
| 101 |
|
else if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].val.value_str32); |
| 102 |
|
else index = args[0].val.value_int32; |
| 103 |
|
//killcount = ONgGameState->CharacterStorage[index].Kills; |
| 110 |
|
uint16_t ONICALL bsl_getdamage(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) |
| 111 |
|
{ |
| 112 |
|
int index; |
| 113 |
< |
if (numargs == 0) index = 0; |
| 113 |
> |
if (argumentEmpty(&args[0])) index = 0; |
| 114 |
|
else if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].val.value_str32); |
| 115 |
|
else index = args[0].val.value_int32; |
| 116 |
|
ret->val.value_int32 = ONgGameState->CharacterStorage[index].Damage; |
| 190 |
|
int index; |
| 191 |
|
Character* Chr; |
| 192 |
|
int* health; |
| 193 |
< |
if (numargs == 0) index = 0; |
| 193 |
> |
if (argumentEmpty(&args[0])) index = 0; |
| 194 |
|
else if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].val.value_str32); |
| 195 |
|
else index = args[0].val.value_int32; |
| 196 |
|
Chr = ONgGameState->CharacterStorage; |
| 211 |
|
{ |
| 212 |
|
int index; |
| 213 |
|
Character* Chr; |
| 214 |
< |
if (numargs == 0) index = 0; |
| 214 |
> |
if (argumentEmpty(&args[0])) index = 0; |
| 215 |
|
else if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].val.value_str32); |
| 216 |
|
else index = args[0].val.value_int32; |
| 217 |
|
Chr = ONgGameState->CharacterStorage ; |
| 218 |
|
|
| 214 |
– |
|
| 219 |
|
/* |
| 220 |
|
DDrConsole_PrintF("Character %s", Chr[index].Name); |
| 221 |
|
DDrConsole_PrintF("Spawn %s", Chr[index].ScriptSpawn); |
| 314 |
|
uint16_t ONICALL bsl_maxhealth(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) |
| 315 |
|
{ |
| 316 |
|
int index; |
| 317 |
< |
if (numargs == 0) index = 0; |
| 317 |
> |
if (argumentEmpty(&args[0])) index = 0; |
| 318 |
|
else if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].val.value_str32); |
| 319 |
|
else index = args[0].val.value_int32; |
| 320 |
|
if(1) { |
| 339 |
|
//broken |
| 340 |
|
|
| 341 |
|
int index; |
| 342 |
< |
if (numargs == 0) index = 0; |
| 342 |
> |
if (argumentEmpty(&args[0])) index = 0; |
| 343 |
|
else if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].val.value_str32); |
| 344 |
|
else index = args[0].val.value_int32; |
| 345 |
|
if(1) { |
| 359 |
|
int index; |
| 360 |
|
char* name; |
| 361 |
|
|
| 362 |
< |
if (numargs == 0) index = 0; |
| 362 |
> |
if (argumentEmpty(&args[0])) index = 0; |
| 363 |
|
else if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].val.value_str32); |
| 364 |
|
else index = args[0].val.value_int32; |
| 365 |
|
if (index == -1) { |
| 398 |
|
{ |
| 399 |
|
numargs++; |
| 400 |
|
} |
| 401 |
< |
if(numargs == 0) return 0; |
| 401 |
> |
if(argumentEmpty(&args[0])) return 0; |
| 402 |
|
if(numargs > 1 ) color.R = (char)args[1].val.value_int32; |
| 403 |
|
else color.R = 255; |
| 404 |
|
if(numargs > 2 ) color.G = (char)args[2].val.value_int32; |
| 696 |
|
uint16_t ONICALL cinematic_start_patch(sl_callinfo* callinfo, unsigned int numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) |
| 697 |
|
{ |
| 698 |
|
args[1].val.value_int32 = (double)args[1].val.value_int32 / (double)(gl->DisplayMode.Width) * (4.0 / 3.0 * (double)(gl->DisplayMode.Height)); |
| 699 |
+ |
// Call orig OCiCinematic_ScriptStart |
| 700 |
|
return ((sl_func)(OniExe + 0x000f3830))(callinfo, numargs, args, dontuse1, dontuse2, ret); |
| 701 |
|
} |
| 702 |
|
|
| 773 |
|
// Patch for cinematic_start to work on widescreen resolutions |
| 774 |
|
void SLrDaodan_Patch() |
| 775 |
|
{ |
| 776 |
+ |
// PUSH OCiCinematic_ScriptStart -> PUSH cinematic_start_patch |
| 777 |
|
DDrPatch_Int32((int*)(OniExe + 0x000f3755), (int)cinematic_start_patch); |
| 778 |
|
} |