mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 08:30:50 +00:00
- BlueShadow's GetArmorInfo submission.
This commit is contained in:
parent
fefe6aa2c1
commit
1fcde91298
1 changed files with 43 additions and 0 deletions
|
@ -120,6 +120,16 @@ FRandom pr_acs ("ACS");
|
||||||
#define SDF_ABSANGLE 1
|
#define SDF_ABSANGLE 1
|
||||||
#define SDF_PERMANENT 2
|
#define SDF_PERMANENT 2
|
||||||
|
|
||||||
|
// GetArmorInfo
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ARMORINFO_CLASSNAME,
|
||||||
|
ARMORINFO_SAVEAMOUNT,
|
||||||
|
ARMORINFO_SAVEPERCENT,
|
||||||
|
ARMORINFO_MAXABSORB,
|
||||||
|
ARMORINFO_MAXFULLABSORB,
|
||||||
|
};
|
||||||
|
|
||||||
struct CallReturn
|
struct CallReturn
|
||||||
{
|
{
|
||||||
CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, ACSLocalArrays *arrays, bool discard, unsigned int runaway)
|
CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, ACSLocalArrays *arrays, bool discard, unsigned int runaway)
|
||||||
|
@ -4349,6 +4359,7 @@ enum EACSFunctions
|
||||||
ACSF_GetActorPowerupTics,
|
ACSF_GetActorPowerupTics,
|
||||||
ACSF_ChangeActorAngle,
|
ACSF_ChangeActorAngle,
|
||||||
ACSF_ChangeActorPitch, // 80
|
ACSF_ChangeActorPitch, // 80
|
||||||
|
ACSF_GetArmorInfo,
|
||||||
|
|
||||||
/* Zandronum's - these must be skipped when we reach 99!
|
/* Zandronum's - these must be skipped when we reach 99!
|
||||||
-100:ResetMap(0),
|
-100:ResetMap(0),
|
||||||
|
@ -4822,6 +4833,38 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args, const
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case ACSF_GetArmorInfo:
|
||||||
|
{
|
||||||
|
if (activator == NULL || activator->player == NULL) return 0;
|
||||||
|
|
||||||
|
ABasicArmor * equippedarmor = (ABasicArmor *) activator->FindInventory(NAME_BasicArmor);
|
||||||
|
|
||||||
|
if (equippedarmor && equippedarmor->Amount != 0)
|
||||||
|
{
|
||||||
|
switch(args[0])
|
||||||
|
{
|
||||||
|
case ARMORINFO_CLASSNAME:
|
||||||
|
return GlobalACSStrings.AddString(equippedarmor->ArmorType.GetChars(), stack, stackdepth);
|
||||||
|
|
||||||
|
case ARMORINFO_SAVEAMOUNT:
|
||||||
|
return equippedarmor->MaxAmount;
|
||||||
|
|
||||||
|
case ARMORINFO_SAVEPERCENT:
|
||||||
|
return equippedarmor->SavePercent;
|
||||||
|
|
||||||
|
case ARMORINFO_MAXABSORB:
|
||||||
|
return equippedarmor->MaxAbsorb;
|
||||||
|
|
||||||
|
case ARMORINFO_MAXFULLABSORB:
|
||||||
|
return equippedarmor->MaxFullAbsorb;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return args[0] == ARMORINFO_CLASSNAME ? GlobalACSStrings.AddString("None", stack, stackdepth) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
case ACSF_SpawnSpotForced:
|
case ACSF_SpawnSpotForced:
|
||||||
return DoSpawnSpot(args[0], args[1], args[2], args[3], true);
|
return DoSpawnSpot(args[0], args[1], args[2], args[3], true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue