mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 01:02:03 +00:00
- use the function defaults from the script instead of explicitly setting them again in the code. This is a needless cause of potential errors and since the values are readily available now it's better to use them in the functions.
- fixed: ZCCCompiler did not process array access nodes. - fixed: Function argument names were not placed in the destination list by the compiler. - scriptified several trivial functions from p_actionfunctions.cpp.
This commit is contained in:
parent
66b1f36e56
commit
948ef62fcd
13 changed files with 707 additions and 996 deletions
17
src/info.h
17
src/info.h
|
@ -356,21 +356,4 @@ int GetSpriteIndex(const char * spritename, bool add = true);
|
|||
TArray<FName> &MakeStateNameList(const char * fname);
|
||||
void AddStateLight(FState *state, const char *lname);
|
||||
|
||||
// Standard parameters for all action functons
|
||||
// self - Actor this action is to operate on (player if a weapon)
|
||||
// stateowner - Actor this action really belongs to (may be an item)
|
||||
// callingstate - State this action was called from
|
||||
#define PARAM_ACTION_PROLOGUE(type) \
|
||||
PARAM_PROLOGUE; \
|
||||
PARAM_OBJECT (self, type); \
|
||||
PARAM_OBJECT_OPT (stateowner, AActor) { stateowner = self; } \
|
||||
PARAM_STATEINFO_OPT (stateinfo) { stateinfo = nullptr; } \
|
||||
|
||||
// Number of action paramaters
|
||||
#define NAP 3
|
||||
|
||||
#define PARAM_SELF_PROLOGUE(type) \
|
||||
PARAM_PROLOGUE; \
|
||||
PARAM_OBJECT(self, type);
|
||||
|
||||
#endif // __INFO_H__
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -386,6 +386,14 @@ bool AActor::FixMapthingPos()
|
|||
return success;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, UnlinkFromWorld)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
self->UnlinkFromWorld();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// P_SetThingPosition
|
||||
|
@ -508,6 +516,13 @@ void AActor::LinkToWorld(bool spawningmapthing, sector_t *sector)
|
|||
if (!spawningmapthing) UpdateRenderSectorList();
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, LinkToWorld)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
self->LinkToWorld();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AActor::SetOrigin(double x, double y, double z, bool moving)
|
||||
{
|
||||
UnlinkFromWorld ();
|
||||
|
|
|
@ -539,12 +539,13 @@ ExpEmit FxBoolCast::Emit(VMFunctionBuilder *build)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FxIntCast::FxIntCast(FxExpression *x, bool nowarn)
|
||||
FxIntCast::FxIntCast(FxExpression *x, bool nowarn, bool explicitly)
|
||||
: FxExpression(EFX_IntCast, x->ScriptPosition)
|
||||
{
|
||||
basex=x;
|
||||
ValueType = TypeSInt32;
|
||||
NoWarn = nowarn;
|
||||
Explicit = explicitly;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -571,9 +572,10 @@ FxExpression *FxIntCast::Resolve(FCompileContext &ctx)
|
|||
|
||||
if (basex->ValueType->GetRegType() == REGT_INT)
|
||||
{
|
||||
if (basex->ValueType != TypeName)
|
||||
if (basex->ValueType != TypeName || Explicit) // names can be converted to int, but only with an explicit type cast.
|
||||
{
|
||||
FxExpression *x = basex;
|
||||
x->ValueType = ValueType;
|
||||
basex = NULL;
|
||||
delete this;
|
||||
return x;
|
||||
|
@ -582,7 +584,8 @@ FxExpression *FxIntCast::Resolve(FCompileContext &ctx)
|
|||
{
|
||||
// Ugh. This should abort, but too many mods fell into this logic hole somewhere, so this seroious error needs to be reduced to a warning. :(
|
||||
// At least in ZScript, MSG_OPTERROR always means to report an error, not a warning so the problem only exists in DECORATE.
|
||||
if (!basex->isConstant()) ScriptPosition.Message(MSG_OPTERROR, "Numeric type expected, got a name");
|
||||
if (!basex->isConstant())
|
||||
ScriptPosition.Message(MSG_OPTERROR, "Numeric type expected, got a name");
|
||||
else ScriptPosition.Message(MSG_OPTERROR, "Numeric type expected, got \"%s\"", static_cast<FxConstant*>(basex)->GetValue().GetName().GetChars());
|
||||
FxExpression * x = new FxConstant(0, ScriptPosition);
|
||||
delete this;
|
||||
|
@ -1062,11 +1065,13 @@ ExpEmit FxSoundCast::Emit(VMFunctionBuilder *build)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FxTypeCast::FxTypeCast(FxExpression *x, PType *type, bool nowarn)
|
||||
FxTypeCast::FxTypeCast(FxExpression *x, PType *type, bool nowarn, bool explicitly)
|
||||
: FxExpression(EFX_TypeCast, x->ScriptPosition)
|
||||
{
|
||||
basex = x;
|
||||
ValueType = type;
|
||||
NoWarn = nowarn;
|
||||
Explicit = explicitly;
|
||||
assert(ValueType != nullptr);
|
||||
}
|
||||
|
||||
|
@ -1126,7 +1131,7 @@ FxExpression *FxTypeCast::Resolve(FCompileContext &ctx)
|
|||
else if (ValueType->IsA(RUNTIME_CLASS(PInt)))
|
||||
{
|
||||
// This is only for casting to actual ints. Subtypes representing an int will be handled elsewhere.
|
||||
FxExpression *x = new FxIntCast(basex, NoWarn);
|
||||
FxExpression *x = new FxIntCast(basex, NoWarn, Explicit);
|
||||
x = x->Resolve(ctx);
|
||||
basex = nullptr;
|
||||
delete this;
|
||||
|
@ -4964,12 +4969,31 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx)
|
|||
return x->Resolve(ctx);
|
||||
}
|
||||
|
||||
// Last but not least: Check builtins. The random functions can take a named RNG if specified.
|
||||
// Last but not least: Check builtins and type casts. The random functions can take a named RNG if specified.
|
||||
// Note that for all builtins the used arguments have to be nulled in the ArgList so that they won't get deleted before they get used.
|
||||
FxExpression *func = nullptr;
|
||||
|
||||
switch (MethodName)
|
||||
{
|
||||
case NAME_Int:
|
||||
case NAME_uInt:
|
||||
case NAME_Double:
|
||||
case NAME_Name:
|
||||
case NAME_Color:
|
||||
case NAME_Sound:
|
||||
if (CheckArgSize(MethodName, ArgList, 1, 1, ScriptPosition))
|
||||
{
|
||||
PType *type = MethodName == NAME_Int ? TypeSInt32 :
|
||||
MethodName == NAME_uInt ? TypeUInt32 :
|
||||
MethodName == NAME_Double ? TypeFloat64 :
|
||||
MethodName == NAME_Name ? TypeName :
|
||||
MethodName == NAME_Color ? TypeColor : (PType*)TypeSound;
|
||||
|
||||
func = new FxTypeCast((*ArgList)[0], type, true, true);
|
||||
(*ArgList)[0] = nullptr;
|
||||
}
|
||||
break;
|
||||
|
||||
case NAME_Random:
|
||||
if (CheckArgSize(NAME_Random, ArgList, 2, 2, ScriptPosition))
|
||||
{
|
||||
|
@ -5044,6 +5068,7 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx)
|
|||
break;
|
||||
|
||||
default:
|
||||
// todo: Check for class type casts
|
||||
break;
|
||||
}
|
||||
if (func != nullptr)
|
||||
|
@ -5216,8 +5241,11 @@ FxExpression *FxActionSpecialCall::Resolve(FCompileContext& ctx)
|
|||
for (unsigned i = 0; i < ArgList->Size(); i++)
|
||||
{
|
||||
(*ArgList)[i] = (*ArgList)[i]->Resolve(ctx);
|
||||
if ((*ArgList)[i] == NULL) failed = true;
|
||||
if (Special < 0 && i == 0)
|
||||
if ((*ArgList)[i] == NULL)
|
||||
{
|
||||
failed = true;
|
||||
}
|
||||
else if (Special < 0 && i == 0)
|
||||
{
|
||||
if ((*ArgList)[i]->ValueType != TypeName)
|
||||
{
|
||||
|
@ -5409,10 +5437,16 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
if (ArgList != NULL)
|
||||
if (ArgList != nullptr)
|
||||
{
|
||||
bool foundvarargs = false;
|
||||
PType * type = nullptr;
|
||||
if (ArgList->Size() + implicit > proto->ArgumentTypes.Size())
|
||||
{
|
||||
ScriptPosition.Message(MSG_ERROR, "Too many arguments in call to %s", Function->SymbolName.GetChars());
|
||||
delete this;
|
||||
return nullptr;
|
||||
}
|
||||
for (unsigned i = 0; i < ArgList->Size(); i++)
|
||||
{
|
||||
// Varargs must all have the same type as the last typed argument. A_Jump is the only function using it.
|
||||
|
@ -5476,24 +5510,23 @@ ExpEmit FxVMFunctionCall::Emit(VMFunctionBuilder *build)
|
|||
assert(selfemit.RegType == REGT_POINTER);
|
||||
build->Emit(OP_PARAM, 0, selfemit.RegType, selfemit.RegNum);
|
||||
count += 1;
|
||||
}
|
||||
if (Function->Variants[0].Flags & VARF_Action)
|
||||
{
|
||||
static_assert(NAP == 3, "This code needs to be updated if NAP changes");
|
||||
if (build->IsActionFunc)
|
||||
if (Function->Variants[0].Flags & VARF_Action)
|
||||
{
|
||||
build->Emit(OP_PARAM, 0, REGT_POINTER, 1);
|
||||
build->Emit(OP_PARAM, 0, REGT_POINTER, 2);
|
||||
static_assert(NAP == 3, "This code needs to be updated if NAP changes");
|
||||
if (build->IsActionFunc && selfemit.RegNum == 0) // only pass this function's stateowner and stateinfo if the subfunction is run in self's context.
|
||||
{
|
||||
build->Emit(OP_PARAM, 0, REGT_POINTER, 1);
|
||||
build->Emit(OP_PARAM, 0, REGT_POINTER, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// pass self as stateowner, otherwise all attempts of the subfunction to retrieve a state from a name would fail.
|
||||
build->Emit(OP_PARAM, 0, selfemit.RegType, selfemit.RegNum);
|
||||
build->Emit(OP_PARAM, 0, REGT_POINTER | REGT_KONST, build->GetConstantAddress(nullptr, ATAG_GENERIC));
|
||||
}
|
||||
count += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
int null = build->GetConstantAddress(nullptr, ATAG_GENERIC);
|
||||
build->Emit(OP_PARAM, 0, REGT_POINTER | REGT_KONST, null);
|
||||
build->Emit(OP_PARAM, 0, REGT_POINTER | REGT_KONST, null);
|
||||
}
|
||||
count += 2;
|
||||
}
|
||||
|
||||
// Emit code to pass explicit parameters
|
||||
if (ArgList != NULL)
|
||||
{
|
||||
|
|
|
@ -474,10 +474,11 @@ class FxIntCast : public FxExpression
|
|||
{
|
||||
FxExpression *basex;
|
||||
bool NoWarn;
|
||||
bool Explicit;
|
||||
|
||||
public:
|
||||
|
||||
FxIntCast(FxExpression *x, bool nowarn);
|
||||
FxIntCast(FxExpression *x, bool nowarn, bool explicitly = false);
|
||||
~FxIntCast();
|
||||
FxExpression *Resolve(FCompileContext&);
|
||||
|
||||
|
@ -559,10 +560,11 @@ class FxTypeCast : public FxExpression
|
|||
{
|
||||
FxExpression *basex;
|
||||
bool NoWarn;
|
||||
bool Explicit;
|
||||
|
||||
public:
|
||||
|
||||
FxTypeCast(FxExpression *x, PType *type, bool nowarn);
|
||||
FxTypeCast(FxExpression *x, PType *type, bool nowarn, bool explicitly = false);
|
||||
~FxTypeCast();
|
||||
FxExpression *Resolve(FCompileContext&);
|
||||
|
||||
|
|
|
@ -67,8 +67,8 @@ static FFlagDef ActorFlagDefs[]=
|
|||
DEFINE_FLAG(MF, SPECIAL, APlayerPawn, flags),
|
||||
DEFINE_FLAG(MF, SOLID, AActor, flags),
|
||||
DEFINE_FLAG(MF, SHOOTABLE, AActor, flags),
|
||||
DEFINE_READONLY_FLAG(MF, NOSECTOR, AActor, flags),
|
||||
DEFINE_READONLY_FLAG(MF, NOBLOCKMAP, AActor, flags),
|
||||
DEFINE_FLAG(MF, NOSECTOR, AActor, flags),
|
||||
DEFINE_FLAG(MF, NOBLOCKMAP, AActor, flags),
|
||||
DEFINE_FLAG(MF, AMBUSH, AActor, flags),
|
||||
DEFINE_FLAG(MF, JUSTHIT, AActor, flags),
|
||||
DEFINE_FLAG(MF, JUSTATTACKED, AActor, flags),
|
||||
|
@ -84,8 +84,8 @@ static FFlagDef ActorFlagDefs[]=
|
|||
DEFINE_FLAG(MF, NOBLOOD, AActor, flags),
|
||||
DEFINE_FLAG(MF, CORPSE, AActor, flags),
|
||||
DEFINE_FLAG(MF, INFLOAT, AActor, flags),
|
||||
DEFINE_READONLY_FLAG(MF, COUNTKILL, AActor, flags),
|
||||
DEFINE_READONLY_FLAG(MF, COUNTITEM, AActor, flags),
|
||||
DEFINE_FLAG(MF, COUNTKILL, AActor, flags),
|
||||
DEFINE_FLAG(MF, COUNTITEM, AActor, flags),
|
||||
DEFINE_FLAG(MF, SKULLFLY, AActor, flags),
|
||||
DEFINE_FLAG(MF, NOTDMATCH, AActor, flags),
|
||||
DEFINE_FLAG(MF, SPAWNSOUNDSOURCE, AActor, flags),
|
||||
|
@ -186,7 +186,7 @@ static FFlagDef ActorFlagDefs[]=
|
|||
DEFINE_FLAG(MF5, GETOWNER, AActor, flags5),
|
||||
DEFINE_FLAG(MF5, NODROPOFF, AActor, flags5),
|
||||
DEFINE_FLAG(MF5, NOFORWARDFALL, AActor, flags5),
|
||||
DEFINE_READONLY_FLAG(MF5, COUNTSECRET, AActor, flags5),
|
||||
DEFINE_FLAG(MF5, COUNTSECRET, AActor, flags5),
|
||||
DEFINE_FLAG(MF5, NODAMAGE, AActor, flags5),
|
||||
DEFINE_FLAG(MF5, BLOODSPLATTER, AActor, flags5),
|
||||
DEFINE_FLAG(MF5, OLDRADIUSDMG, AActor, flags5),
|
||||
|
@ -677,10 +677,20 @@ void InitThingdef()
|
|||
symt.AddSymbol(new PField(NAME_ReactionTime, TypeSInt32, VARF_Native, myoffsetof(AActor, reactiontime)));
|
||||
symt.AddSymbol(new PField(NAME_MeleeRange, TypeFloat64, VARF_Native, myoffsetof(AActor, meleerange)));
|
||||
symt.AddSymbol(new PField(NAME_Speed, TypeFloat64, VARF_Native, myoffsetof(AActor, Speed)));
|
||||
symt.AddSymbol(new PField(NAME_Threshold, TypeSInt32, VARF_Native|VARF_ReadOnly, myoffsetof(AActor, threshold)));
|
||||
symt.AddSymbol(new PField("FloatSpeed", TypeFloat64, VARF_Native, myoffsetof(AActor, FloatSpeed)));
|
||||
symt.AddSymbol(new PField("PainThreshold", TypeSInt32, VARF_Native, myoffsetof(AActor, PainThreshold)));
|
||||
symt.AddSymbol(new PField("spriteAngle", TypeFloat64, VARF_Native, myoffsetof(AActor, SpriteAngle)));
|
||||
symt.AddSymbol(new PField("spriteRotation", TypeFloat64, VARF_Native, myoffsetof(AActor, SpriteRotation)));
|
||||
symt.AddSymbol(new PField(NAME_Threshold, TypeSInt32, VARF_Native, myoffsetof(AActor, threshold)));
|
||||
symt.AddSymbol(new PField(NAME_DefThreshold, TypeSInt32, VARF_Native|VARF_ReadOnly, myoffsetof(AActor, DefThreshold)));
|
||||
symt.AddSymbol(new PField(NAME_Damage, TypeSInt32, VARF_Native|VARF_ReadOnly, myoffsetof(AActor, DamageVal)));
|
||||
symt.AddSymbol(new PField("visdir", TypeSInt32, VARF_Native, myoffsetof(AActor, visdir)));
|
||||
symt.AddSymbol(new PField("Gravity", TypeFloat64, VARF_Native, myoffsetof(AActor, Gravity)));
|
||||
symt.AddSymbol(new PField("DamageType", TypeName, VARF_Native, myoffsetof(AActor, DamageType)));
|
||||
symt.AddSymbol(new PField("FloatBobPhase", TypeUInt8, VARF_Native, myoffsetof(AActor, FloatBobPhase)));
|
||||
symt.AddSymbol(new PField("RipperLevel", TypeSInt32, VARF_Native, myoffsetof(AActor, RipperLevel)));
|
||||
symt.AddSymbol(new PField("RipLevelMin", TypeSInt32, VARF_Native, myoffsetof(AActor, RipLevelMin)));
|
||||
symt.AddSymbol(new PField("RipLevelMax", TypeSInt32, VARF_Native, myoffsetof(AActor, RipLevelMax)));
|
||||
symt.AddSymbol(new PField(NAME_VisibleStartAngle, TypeFloat64, VARF_Native, myoffsetof(AActor, VisibleStartAngle)));
|
||||
symt.AddSymbol(new PField(NAME_VisibleStartPitch, TypeFloat64, VARF_Native, myoffsetof(AActor, VisibleStartPitch)));
|
||||
symt.AddSymbol(new PField(NAME_VisibleEndAngle, TypeFloat64, VARF_Native, myoffsetof(AActor, VisibleEndAngle)));
|
||||
|
@ -693,6 +703,8 @@ void InitThingdef()
|
|||
symt.AddSymbol(new PField(NAME_Target, TypeActor, VARF_Native, myoffsetof(AActor, target)));
|
||||
symt.AddSymbol(new PField(NAME_Master, TypeActor, VARF_Native, myoffsetof(AActor, master)));
|
||||
symt.AddSymbol(new PField(NAME_Tracer, TypeActor, VARF_Native, myoffsetof(AActor, tracer)));
|
||||
symt.AddSymbol(new PField("LastHeard", TypeActor, VARF_Native, myoffsetof(AActor, LastHeard)));
|
||||
symt.AddSymbol(new PField("LastEnemy", TypeActor, VARF_Native, myoffsetof(AActor, lastenemy)));
|
||||
|
||||
// synthesize a symbol for each flag. The bounce flags are excluded on purpose.
|
||||
for (size_t i = 0; i < countof(ActorFlagDefs); i++)
|
||||
|
|
|
@ -925,7 +925,7 @@ void VMDisasm(FILE *out, const VMOP *code, int codesize, const VMScriptFunction
|
|||
// PARAM_INT_OPT(0,myint) { myint = 55; }
|
||||
// Just make sure to fill it in when using these macros, because the compiler isn't likely
|
||||
// to give useful error messages if you don't.
|
||||
#define PARAM_EXISTS ((p) < numparam && param[p].Type != REGT_NIL)
|
||||
#define PARAM_EXISTS(p) ((p) < numparam && param[p].Type != REGT_NIL)
|
||||
#define ASSERTINT(p) assert((p).Type == REGT_INT)
|
||||
#define ASSERTFLOAT(p) assert((p).Type == REGT_FLOAT)
|
||||
#define ASSERTSTRING(p) assert((p).Type == REGT_STRING)
|
||||
|
@ -933,7 +933,18 @@ void VMDisasm(FILE *out, const VMOP *code, int codesize, const VMScriptFunction
|
|||
#define ASSERTPOINTER(p) assert((p).Type == REGT_POINTER && (p).atag == ATAG_GENERIC)
|
||||
#define ASSERTSTATE(p) assert((p).Type == REGT_POINTER && ((p).atag == ATAG_GENERIC || (p).atag == ATAG_STATE))
|
||||
|
||||
#define PARAM_INT_DEF_AT(p,x) int x; if (PARAM_EXISTS) { ASSERTINT(param[p]); x = param[p].i; } else { ASSERTINT(defaultparam[p]); x = defaultparam[p].i; }
|
||||
#define PARAM_INT_DEF_AT(p,x) int x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = param[p].i; } else { ASSERTINT(defaultparam[p]); x = defaultparam[p].i; }
|
||||
#define PARAM_BOOL_DEF_AT(p,x) bool x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = !!param[p].i; } else { ASSERTINT(defaultparam[p]); x = !!defaultparam[p].i; }
|
||||
#define PARAM_NAME_DEF_AT(p,x) FName x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = ENamedName(param[p].i); } else { ASSERTINT(defaultparam[p]); x = ENamedName(defaultparam[p].i); }
|
||||
#define PARAM_SOUND_DEF_AT(p,x) FSoundID x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = FSoundID(param[p].i); } else { ASSERTINT(defaultparam[p]); x = FSoundID(defaultparam[p].i); }
|
||||
#define PARAM_COLOR_DEF_AT(p,x) PalEntry x; if (PARAM_EXISTS(p)) { ASSERTINT(param[p]); x = param[p].i; } else { ASSERTINT(defaultparam[p]); x = defaultparam[p].i; }
|
||||
#define PARAM_FLOAT_DEF_AT(p,x) double x; if (PARAM_EXISTS(p)) { ASSERTFLOAT(param[p]); x = param[p].f; } else { ASSERTFLOAT(defaultparam[p]); x = defaultparam[p].f; }
|
||||
#define PARAM_ANGLE_DEF_AT(p,x) DAngle x; if (PARAM_EXISTS(p)) { ASSERTFLOAT(param[p]); x = param[p].f; } else { ASSERTFLOAT(defaultparam[p]); x = defaultparam[p].f; }
|
||||
#define PARAM_STRING_DEF_AT(p,x) FString x; if (PARAM_EXISTS(p)) { ASSERTSTRING(param[p]); x = param[p].s; } else { ASSERTSTRING(defaultparam[p]); x = defaultparam[p].s; }
|
||||
#define PARAM_STATE_DEF_AT(p,x) FState *x; if (PARAM_EXISTS(p)) { ASSERTSTATE(param[p]); x = (FState*)param[p].a; } else { ASSERTSTATE(defaultparam[p]); x = (FState*)defaultparam[p].a; }
|
||||
#define PARAM_POINTER_DEF_AT(p,x,t) t *x; if (PARAM_EXISTS(p)) { ASSERTPOINTER(param[p]); x = (t*)param[p].a; } else { ASSERTPOINTER(defaultparam[p]); x = (t*)defaultparam[p].a; }
|
||||
#define PARAM_OBJECT_DEF_AT(p,x,t) t *x; if (PARAM_EXISTS(p)) { ASSERTOBJECT(param[p]); x = (t*)param[p].a; } else { ASSERTOBJECT(defaultparam[p]); x = (t*)defaultparam[p].a; }
|
||||
#define PARAM_CLASS_DEF_AT(p,x,t) t::MetaClass *x; if (PARAM_EXISTS(p)) { ASSERTOBJECT(param[p]); x = (t::MetaClass*)param[p].a; } else { ASSERTOBJECT(defaultparam[p]); x = (t::MetaClass*)defaultparam[p].a; }
|
||||
|
||||
#define PARAM_INT_OPT_AT(p,x) int x; if ((p) < numparam && param[p].Type != REGT_NIL) { assert(param[p].Type == REGT_INT); x = param[p].i; } else
|
||||
#define PARAM_BOOL_OPT_AT(p,x) bool x; if ((p) < numparam && param[p].Type != REGT_NIL) { assert(param[p].Type == REGT_INT); x = !!param[p].i; } else
|
||||
|
@ -1048,6 +1059,24 @@ struct AFuncDesc
|
|||
#define ACTION_CALL_FROM_PSPRITE() (self->player && stateinfo != nullptr && stateinfo->mStateType == STATE_Psprite)
|
||||
#define ACTION_CALL_FROM_INVENTORY() (stateinfo != nullptr && stateinfo->mStateType == STATE_StateChain)
|
||||
|
||||
// Standard parameters for all action functons
|
||||
// self - Actor this action is to operate on (player if a weapon)
|
||||
// stateowner - Actor this action really belongs to (may be an item)
|
||||
// callingstate - State this action was called from
|
||||
#define PARAM_ACTION_PROLOGUE(type) \
|
||||
PARAM_PROLOGUE; \
|
||||
PARAM_OBJECT (self, type); \
|
||||
PARAM_OBJECT_OPT (stateowner, AActor) { stateowner = self; } \
|
||||
PARAM_STATEINFO_OPT (stateinfo) { stateinfo = nullptr; } \
|
||||
|
||||
// Number of action paramaters
|
||||
#define NAP 3
|
||||
|
||||
#define PARAM_SELF_PROLOGUE(type) \
|
||||
PARAM_PROLOGUE; \
|
||||
PARAM_OBJECT(self, type);
|
||||
|
||||
|
||||
class PFunction;
|
||||
|
||||
PFunction *FindGlobalActionFunction(const char *name);
|
||||
|
|
|
@ -175,13 +175,13 @@ begin:
|
|||
OP(LO):
|
||||
ASSERTA(a); ASSERTA(B); ASSERTKD(C);
|
||||
GETADDR(PB,KC,X_READ_NIL);
|
||||
reg.a[a] = *(void **)ptr;
|
||||
reg.a[a] = GC::ReadBarrier(*(DObject **)ptr);
|
||||
reg.atag[a] = ATAG_OBJECT;
|
||||
NEXTOP;
|
||||
OP(LO_R):
|
||||
ASSERTA(a); ASSERTA(B); ASSERTD(C);
|
||||
GETADDR(PB,RC,X_READ_NIL);
|
||||
reg.a[a] = *(void **)ptr;
|
||||
reg.a[a] = GC::ReadBarrier(*(DObject **)ptr);
|
||||
reg.atag[a] = ATAG_OBJECT;
|
||||
NEXTOP;
|
||||
OP(LP):
|
||||
|
|
|
@ -2102,12 +2102,14 @@ void ZCCCompiler::InitFunctions()
|
|||
// TBD: disallow certain types? For now, let everything pass that isn't an array.
|
||||
args.Push(type);
|
||||
argflags.Push(flags);
|
||||
argnames.Push(p->Name);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
args.Push(nullptr);
|
||||
argflags.Push(0);
|
||||
argnames.Push(NAME_None);
|
||||
}
|
||||
argdefaults.Push(vmval);
|
||||
p = static_cast<decltype(p)>(p->SiblingNext);
|
||||
|
@ -2120,7 +2122,7 @@ void ZCCCompiler::InitFunctions()
|
|||
|
||||
if (!(f->Flags & ZCC_Native))
|
||||
{
|
||||
auto code = ConvertAST(f->Body);
|
||||
auto code = ConvertAST(c->Type(), f->Body);
|
||||
if (code != nullptr)
|
||||
{
|
||||
sym->Variants[0].Implementation = FunctionBuildList.AddFunction(sym, code, FStringf("%s.%s", c->Type()->TypeName.GetChars(), FName(f->Name).GetChars()), false);
|
||||
|
@ -2157,7 +2159,7 @@ static bool CheckRandom(ZCC_Expression *duration)
|
|||
// Sets up the action function call
|
||||
//
|
||||
//==========================================================================
|
||||
FxExpression *ZCCCompiler::SetupActionFunction(PClassActor *cls, ZCC_TreeNode *af)
|
||||
FxExpression *ZCCCompiler::SetupActionFunction(PClass *cls, ZCC_TreeNode *af)
|
||||
{
|
||||
// We have 3 cases to consider here:
|
||||
// 1. An action function without parameters. This can be called directly
|
||||
|
@ -2197,8 +2199,7 @@ FxExpression *ZCCCompiler::SetupActionFunction(PClassActor *cls, ZCC_TreeNode *a
|
|||
}
|
||||
}
|
||||
}
|
||||
ConvertClass = cls;
|
||||
return ConvertAST(af);
|
||||
return ConvertAST(cls, af);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -2419,8 +2420,9 @@ void ZCCCompiler::CompileStates()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FxExpression *ZCCCompiler::ConvertAST(ZCC_TreeNode *ast)
|
||||
FxExpression *ZCCCompiler::ConvertAST(PClass *cls, ZCC_TreeNode *ast)
|
||||
{
|
||||
ConvertClass = cls;
|
||||
// there are two possibilities here: either a single function call or a compound statement. For a compound statement we also need to check if the last thing added was a return.
|
||||
if (ast->NodeType == AST_ExprFuncCall)
|
||||
{
|
||||
|
@ -2680,6 +2682,9 @@ FxExpression *ZCCCompiler::ConvertNode(ZCC_TreeNode *ast)
|
|||
case PEX_LTGTEQ:
|
||||
return new FxLtGtEq(left, right);
|
||||
|
||||
case PEX_ArrayAccess:
|
||||
return new FxArrayElement(left, right);
|
||||
|
||||
// todo: These do not have representations in DECORATE and no implementation exists yet.
|
||||
case PEX_Concat:
|
||||
case PEX_Is:
|
||||
|
|
|
@ -109,7 +109,7 @@ private:
|
|||
|
||||
void InitFunctions();
|
||||
void CompileStates();
|
||||
FxExpression *SetupActionFunction(PClassActor *cls, ZCC_TreeNode *sl);
|
||||
FxExpression *SetupActionFunction(PClass *cls, ZCC_TreeNode *sl);
|
||||
|
||||
bool SimplifyingConstant;
|
||||
TArray<ZCC_ConstantDef *> Constants;
|
||||
|
@ -140,7 +140,7 @@ private:
|
|||
void Error(ZCC_TreeNode *node, const char *msg, ...);
|
||||
void MessageV(ZCC_TreeNode *node, const char *txtcolor, const char *msg, va_list argptr);
|
||||
|
||||
FxExpression *ConvertAST(ZCC_TreeNode *ast);
|
||||
FxExpression *ConvertAST(PClass *cclass, ZCC_TreeNode *ast);
|
||||
FxExpression *ConvertNode(ZCC_TreeNode *node);
|
||||
FArgumentList *ConvertNodeList(ZCC_TreeNode *head);
|
||||
|
||||
|
|
|
@ -47,6 +47,13 @@ class Actor : Thinker native
|
|||
}
|
||||
|
||||
// Functions
|
||||
|
||||
bool IsPointerEqual(int ptr_select1, int ptr_select2)
|
||||
{
|
||||
return GetPointer(ptr_select1) == GetPointer(ptr_select2);
|
||||
}
|
||||
|
||||
native Actor GetPointer(int aaptr);
|
||||
native Actor SpawnMissile(Actor dest, class<Actor> type, Actor owner = null);
|
||||
native void TraceBleed(int damage, Actor missile);
|
||||
native bool CheckMeleeRange();
|
||||
|
@ -56,11 +63,11 @@ class Actor : Thinker native
|
|||
native bool CheckSight(Actor target, int flags = 0);
|
||||
native bool HitFriend();
|
||||
native bool SetState(state st, bool nofunction = false);
|
||||
native void LinkToWorld();
|
||||
native void UnlinkFromWorld();
|
||||
|
||||
|
||||
// DECORATE compatible functions
|
||||
native bool CheckClass(class<Actor> checkclass, int ptr_select = AAPTR_DEFAULT, bool match_superclass = false);
|
||||
native bool IsPointerEqual(int ptr_select1, int ptr_select2);
|
||||
native int CountInv(class<Inventory> itemtype, int ptr_select = AAPTR_DEFAULT);
|
||||
native float GetDistance(bool checkz, int ptr = AAPTR_DEFAULT);
|
||||
native float GetAngle(int flags, int ptr = AAPTR_DEFAULT);
|
||||
|
@ -78,9 +85,89 @@ class Actor : Thinker native
|
|||
action native float OverlayX(int layer = 0);
|
||||
action native float OverlayY(int layer = 0);
|
||||
|
||||
// DECORATE setters - it probably makes more sense to set these values directly now...
|
||||
void A_SetMass(int newmass) { mass = newmass; }
|
||||
void A_SetGravity(float newgravity) { gravity = clamp(newgravity, 0., 10.); }
|
||||
void A_SetArg(int arg, int val) { if (arg >= 0 && arg < 5) args[arg] = val; }
|
||||
void A_Turn(float turn = 0) { angle += turn; }
|
||||
void A_SetDamageType(name newdamagetype) { damagetype = newdamagetype; }
|
||||
void A_SetSolid() { bSolid = true; }
|
||||
void A_UnsetSolid() { bSolid = false; }
|
||||
void A_SetFloat() { bFloat = true; }
|
||||
void A_UnsetFloat() { bFloat = false; }
|
||||
void A_SetFloatBobPhase(int bob) { if (bob >= 0 && bob <= 63) FloatBobPhase = bob; }
|
||||
void A_SetRipperLevel(int level) { RipperLevel = level; }
|
||||
void A_SetRipMin(int minimum) { RipLevelMin = minimum; }
|
||||
void A_SetRipMax(int maximum) { RipLevelMax = maximum; }
|
||||
|
||||
void A_SetScale(float scalex, float scaley = 0, int ptr = AAPTR_DEFAULT, bool usezero = false)
|
||||
{
|
||||
Actor aptr = GetPointer(ptr);
|
||||
if (aptr)
|
||||
{
|
||||
aptr.Scale.X = scalex;
|
||||
aptr.Scale.Y = scaley != 0 || usezero? scaley : scalex; // use scalex here, too, if only one parameter.
|
||||
}
|
||||
}
|
||||
void A_SetSpeed(float speed, int ptr = AAPTR_DEFAULT)
|
||||
{
|
||||
Actor aptr = GetPointer(ptr);
|
||||
if (aptr) aptr.Speed = speed;
|
||||
}
|
||||
void A_SetFloatSpeed(float speed, int ptr = AAPTR_DEFAULT)
|
||||
{
|
||||
Actor aptr = GetPointer(ptr);
|
||||
if (aptr) aptr.FloatSpeed = speed;
|
||||
}
|
||||
void A_SetPainThreshold(int threshold, int ptr = AAPTR_DEFAULT)
|
||||
{
|
||||
Actor aptr = GetPointer(ptr);
|
||||
if (aptr) aptr.PainThreshold = threshold;
|
||||
}
|
||||
bool A_SetSpriteAngle(float angle = 0, int ptr = AAPTR_DEFAULT)
|
||||
{
|
||||
Actor aptr = GetPointer(ptr);
|
||||
if (!aptr) return false;
|
||||
aptr.SpriteAngle = angle;
|
||||
return true;
|
||||
}
|
||||
bool A_SetSpriteRotation(float angle = 0, int ptr = AAPTR_DEFAULT)
|
||||
{
|
||||
Actor aptr = GetPointer(ptr);
|
||||
if (!aptr) return false;
|
||||
aptr.SpriteRotation = angle;
|
||||
return true;
|
||||
}
|
||||
|
||||
deprecated void A_FaceConsolePlayer(float MaxTurnAngle = 0) {}
|
||||
|
||||
void A_SetSpecial(int spec, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0)
|
||||
{
|
||||
special = spec;
|
||||
args[0] = arg0;
|
||||
args[1] = arg1;
|
||||
args[2] = arg2;
|
||||
args[3] = arg3;
|
||||
args[4] = arg4;
|
||||
}
|
||||
|
||||
void A_ClearTarget()
|
||||
{
|
||||
target = null;
|
||||
lastheard = null;
|
||||
lastenemy = null;
|
||||
}
|
||||
|
||||
void A_ChangeLinkFlags(int blockmap = FLAG_NO_CHANGE, int sector = FLAG_NO_CHANGE)
|
||||
{
|
||||
UnlinkFromWorld();
|
||||
if (blockmap != FLAG_NO_CHANGE) bNoBlockmap = blockmap;
|
||||
if (sector != FLAG_NO_CHANGE) bNoSector = sector;
|
||||
LinkToWorld();
|
||||
}
|
||||
|
||||
// Action functions
|
||||
// Meh, MBF redundant functions. Only for DeHackEd support.
|
||||
native void A_Turn(float angle = 0);
|
||||
native bool A_LineEffect(int boomspecial = 0, int tag = 0);
|
||||
// End of MBF redundant functions.
|
||||
|
||||
|
@ -121,9 +208,9 @@ class Actor : Thinker native
|
|||
native void A_BrainScream();
|
||||
native void A_BrainDie();
|
||||
native void A_BrainAwake();
|
||||
native void A_BrainSpit(class<Actor> spawntype = "none"); // needs special treatment for default
|
||||
native void A_BrainSpit(class<Actor> spawntype = null); // needs special treatment for default
|
||||
native void A_SpawnSound();
|
||||
native void A_SpawnFly(class<Actor> spawntype = "none"); // needs special treatment for default
|
||||
native void A_SpawnFly(class<Actor> spawntype = null); // needs special treatment for default
|
||||
native void A_BrainExplode();
|
||||
native void A_Die(name damagetype = "none");
|
||||
native void A_Detonate();
|
||||
|
@ -145,12 +232,8 @@ class Actor : Thinker native
|
|||
native void A_NoGravity();
|
||||
native void A_Gravity();
|
||||
native void A_LowGravity();
|
||||
native void A_SetGravity(float gravity);
|
||||
|
||||
native void A_Fall();
|
||||
native void A_SetSolid();
|
||||
native void A_UnsetSolid();
|
||||
native void A_SetFloat();
|
||||
native void A_UnsetFloat();
|
||||
|
||||
native void A_M_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class<Actor> pufftype = "BulletPuff");
|
||||
|
||||
|
@ -186,7 +269,6 @@ class Actor : Thinker native
|
|||
native void A_ClearSoundTarget();
|
||||
native void A_FireAssaultGun();
|
||||
native void A_CheckTerrain();
|
||||
native void A_FaceConsolePlayer(float MaxTurnAngle = 0); // [TP] no-op
|
||||
|
||||
deprecated native void A_MissileAttack();
|
||||
deprecated native void A_MeleeAttack();
|
||||
|
@ -194,7 +276,7 @@ class Actor : Thinker native
|
|||
deprecated native void A_BulletAttack();
|
||||
native void A_WolfAttack(int flags = 0, sound whattoplay = "weapons/pistol", float snipe = 1.0, int maxdamage = 64, int blocksize = 128, int pointblank = 2, int longrange = 4, float runspeed = 160.0, class<Actor> pufftype = "BulletPuff");
|
||||
native void A_PlaySound(sound whattoplay = "weapons/pistol", int slot = CHAN_BODY, float volume = 1.0, bool looping = false, float attenuation = ATTN_NORM);
|
||||
native void A_PlayWeaponSound(sound whattoplay);
|
||||
deprecated void A_PlayWeaponSound(sound whattoplay) { A_PlaySound(whattoplay, CHAN_WEAPON); }
|
||||
native void A_FLoopActiveSound();
|
||||
native void A_LoopActiveSound();
|
||||
native void A_StopSound(int slot = CHAN_VOICE); // Bad default but that's what is originally was...
|
||||
|
@ -204,7 +286,7 @@ class Actor : Thinker native
|
|||
native state A_Jump(int chance = 256, state label, ...);
|
||||
native void A_CustomMissile(class<Actor> missiletype, float spawnheight = 32, float spawnofs_xy = 0, float angle = 0, int flags = 0, float pitch = 0, int ptr = AAPTR_TARGET);
|
||||
native void A_CustomBulletAttack(float spread_xy, float spread_z, int numbullets, int damageperbullet, class<Actor> pufftype = "BulletPuff", float range = 0, int flags = 0, int ptr = AAPTR_TARGET, class<Actor> missile = null, float Spawnheight = 32, float Spawnofs_xy = 0);
|
||||
native void A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = 0, color color2 = 0, int flags = 0, int aim = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = "none", float spawnofs_z = 0, int spiraloffset = 270, int limit = 0);
|
||||
native void A_CustomRailgun(int damage, int spawnofs_xy = 0, color color1 = 0, color color2 = 0, int flags = 0, int aim = 0, float maxdiff = 0, class<Actor> pufftype = "BulletPuff", float spread_xy = 0, float spread_z = 0, float range = 0, int duration = 0, float sparsity = 1.0, float driftspeed = 1.0, class<Actor> spawnclass = null, float spawnofs_z = 0, int spiraloffset = 270, int limit = 0);
|
||||
native state A_JumpIfHealthLower(int health, state label, int ptr_selector = AAPTR_DEFAULT);
|
||||
native state A_JumpIfCloser(float distance, state label, bool noz = false);
|
||||
native state A_JumpIfTracerCloser(float distance, state label, bool noz = false);
|
||||
|
@ -213,6 +295,7 @@ class Actor : Thinker native
|
|||
native state A_JumpIfTargetInsideMeleeRange(state label);
|
||||
native state A_JumpIfInventory(class<Inventory> itemtype, int itemamount, state label, int owner = AAPTR_DEFAULT);
|
||||
native state A_JumpIfArmorType(name Type, state label, int amount = 1);
|
||||
native bool A_SetInventory(class<Inventory> itemtype, int amount, int ptr = AAPTR_DEFAULT, bool beyondMax = false);
|
||||
native bool A_GiveInventory(class<Inventory> itemtype, int amount = 0, int giveto = AAPTR_DEFAULT);
|
||||
native bool A_TakeInventory(class<Inventory> itemtype, int amount = 0, int flags = 0, int giveto = AAPTR_DEFAULT);
|
||||
action native bool A_SpawnItem(class<Actor> itemtype = "Unknown", float distance = 0, float zheight = 0, bool useammo = true, bool transfer_translation = false);
|
||||
|
@ -227,8 +310,6 @@ class Actor : Thinker native
|
|||
native void A_FadeIn(float reduce = 0.1, int flags = 0);
|
||||
native void A_FadeOut(float reduce = 0.1, int flags = 1); //bool remove == true
|
||||
native void A_FadeTo(float target, float amount = 0.1, int flags = 0);
|
||||
native void A_SetScale(float scalex, float scaley = 0, int ptr = AAPTR_DEFAULT, bool usezero = false);
|
||||
native void A_SetMass(int mass);
|
||||
native void A_SpawnDebris(class<Actor> spawntype, bool transfer_translation = false, float mult_h = 1, float mult_v = 1);
|
||||
native void A_SpawnParticle(color color1, int flags = 0, int lifetime = 35, float size = 1, float angle = 0, float xoff = 0, float yoff = 0, float zoff = 0, float velx = 0, float vely = 0, float velz = 0, float accelx = 0, float accely = 0, float accelz = 0, float startalphaf = 1, float fadestepf = -1, float sizestep = 0);
|
||||
native state A_CheckSight(state label);
|
||||
|
@ -238,7 +319,6 @@ class Actor : Thinker native
|
|||
deprecated native void A_ChangeFlag(string flagname, bool value);
|
||||
deprecated native state A_CheckFlag(string flagname, state label, int check_pointer = AAPTR_DEFAULT);
|
||||
native void A_ChangeCountFlags(int kill = FLAG_NO_CHANGE, int item = FLAG_NO_CHANGE, int secret = FLAG_NO_CHANGE);
|
||||
native void A_ChangeLinkFlags(int blockmap = FLAG_NO_CHANGE, int sector = FLAG_NO_CHANGE);
|
||||
native state A_JumpIf(bool expression, state label);
|
||||
native void A_RaiseMaster(bool copy = 0);
|
||||
native void A_RaiseChildren(bool copy = 0);
|
||||
|
@ -247,7 +327,7 @@ class Actor : Thinker native
|
|||
native state A_CheckCeiling(state label);
|
||||
native state A_PlayerSkinCheck(state label);
|
||||
deprecated native void A_BasicAttack(int meleedamage, sound meleesound, class<actor> missiletype, float missileheight);
|
||||
native state, bool A_Teleport(state teleportstate = null, class<SpecialSpot> targettype = "BossSpot", class<Actor> fogtype = "TeleportFog", int flags = 0, float mindist = 0, float maxdist = 0, int ptr = AAPTR_DEFAULT);
|
||||
native state, bool A_Teleport(state teleportstate = null, class<SpecialSpot> targettype = "BossSpot", class<Actor> fogtype = "TeleportFog", int flags = 0, float mindist = 0, float maxdist = 128, int ptr = AAPTR_DEFAULT);
|
||||
native state, bool A_Warp(int ptr_destination, float xofs = 0, float yofs = 0, float zofs = 0, float angle = 0, int flags = 0, state success_state = null, float heightoffset = 0, float radiusoffset = 0, float pitch = 0);
|
||||
action native bool A_ThrowGrenade(class<Actor> itemtype, float zheight = 0, float xyvel = 0, float zvel = 0, bool useammo = true);
|
||||
native void A_Weave(int xspeed, int yspeed, float xdist, float ydist);
|
||||
|
@ -256,7 +336,7 @@ class Actor : Thinker native
|
|||
native state A_JumpIfInTargetInventory(class<Inventory> itemtype, int amount, state label, int forward_ptr = AAPTR_DEFAULT);
|
||||
native bool A_GiveToTarget(class<Inventory> itemtype, int amount = 0, int forward_ptr = AAPTR_DEFAULT);
|
||||
native bool A_TakeFromTarget(class<Inventory> itemtype, int amount = 0, int flags = 0, int forward_ptr = AAPTR_DEFAULT);
|
||||
native int A_RadiusGive(class<Inventory> itemtype, float distance, int flags, int amount = 0, class<Actor> filter = "None", name species = "None", float mindist = 0, int limit = 0);
|
||||
native int A_RadiusGive(class<Inventory> itemtype, float distance, int flags, int amount = 0, class<Actor> filter = null, name species = "None", float mindist = 0, int limit = 0);
|
||||
native state A_CheckSpecies(state jump, name species = 'none', int ptr = AAPTR_DEFAULT);
|
||||
native void A_CountdownArg(int argnum, state targstate = null);
|
||||
native void A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true);
|
||||
|
@ -264,7 +344,7 @@ class Actor : Thinker native
|
|||
native void A_Burst(class<Actor> chunktype);
|
||||
action native void A_Blast(int flags = 0, float strength = 255, float radius = 255, float speed = 20, class<Actor> blasteffect = "BlastEffect", sound blastsound = "BlastRadius");
|
||||
native void A_RadiusThrust(int force = 128, int distance = -1, int flags = RTF_AFFECTSOURCE, int fullthrustdistance = 0);
|
||||
native void A_RadiusDamageSelf(int damage = 128, float distance = 128, int flags = 0, class<Actor> flashtype = "None");
|
||||
native void A_RadiusDamageSelf(int damage = 128, float distance = 128, int flags = 0, class<Actor> flashtype = null);
|
||||
native int A_Explode(int damage = -1, int distance = -1, int flags = XF_HURTSOURCE, bool alert = false, int fulldamagedistance = 0, int nails = 0, int naildamage = 10, class<Actor> pufftype = "BulletPuff", name damagetype = "none");
|
||||
native void A_Stop();
|
||||
native void A_Respawn(int flags = 1);
|
||||
|
@ -273,7 +353,6 @@ class Actor : Thinker native
|
|||
native void A_DeQueueCorpse();
|
||||
native void A_LookEx(int flags = 0, float minseedist = 0, float maxseedist = 0, float maxheardist = 0, float fov = 0, state label = null);
|
||||
native void A_ClearLastHeard();
|
||||
native void A_ClearTarget();
|
||||
native state A_CheckLOF(state jump, int flags = 0, float range = 0, float minrange = 0, float angle = 0, float pitch = 0, float offsetheight = 0, float offsetwidth = 0, int ptr_target = AAPTR_DEFAULT, float offsetforward = 0);
|
||||
native state A_JumpIfTargetInLOS (state label, float fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0);
|
||||
native state A_JumpIfInTargetLOS (state label, float fov = 0, int flags = 0, float dist_max = 0, float dist_close = 0);
|
||||
|
@ -295,51 +374,41 @@ class Actor : Thinker native
|
|||
native void A_SetRoll(float roll, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
native void A_ScaleVelocity(float scale, int ptr = AAPTR_DEFAULT);
|
||||
native void A_ChangeVelocity(float x = 0, float y = 0, float z = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
native void A_SetArg(int pos, int value);
|
||||
deprecated native void A_SetUserVar(name varname, int value);
|
||||
deprecated native void A_SetUserArray(name varname, int index, int value);
|
||||
deprecated native void A_SetUserVarFloat(name varname, float value);
|
||||
deprecated native void A_SetUserArrayFloat(name varname, int index, float value);
|
||||
native void A_SetSpecial(int spec, int arg0 = 0, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0);
|
||||
native void A_Quake(int intensity, int duration, int damrad, int tremrad, sound sfx = "world/quake");
|
||||
native void A_QuakeEx(int intensityX, int intensityY, int intensityZ, int duration, int damrad, int tremrad, sound sfx = "world/quake", int flags = 0, float mulWaveX = 1, float mulWaveY = 1, float mulWaveZ = 1, int falloff = 0, int highpoint = 0, float rollIntensity = 0, float rollWave = 0);
|
||||
action native void A_SetTics(int tics);
|
||||
native void A_SetDamageType(name damagetype);
|
||||
native void A_DropItem(class<Actor> item, int dropamount = -1, int chance = 256);
|
||||
native void A_SetSpeed(float speed, int ptr = AAPTR_DEFAULT);
|
||||
native void A_SetFloatSpeed(float speed, int ptr = AAPTR_DEFAULT);
|
||||
native void A_SetPainThreshold(int threshold, int ptr = AAPTR_DEFAULT);
|
||||
native void A_DamageSelf(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageTarget(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageMaster(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageTracer(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageChildren(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageSiblings(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillTarget(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillMaster(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillTracer(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillChildren(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillSiblings(name damagetype = "none", int flags = 0, class<Actor> filter = "None", name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_RemoveTarget(int flags = 0, class<Actor> filter = "None", name species = "None");
|
||||
native void A_RemoveMaster(int flags = 0, class<Actor> filter = "None", name species = "None");
|
||||
native void A_RemoveTracer(int flags = 0, class<Actor> filter = "None", name species = "None");
|
||||
native void A_RemoveChildren(bool removeall = false, int flags = 0, class<Actor> filter = "None", name species = "None");
|
||||
native void A_RemoveSiblings(bool removeall = false, int flags = 0, class<Actor> filter = "None", name species = "None");
|
||||
native void A_Remove(int removee, int flags = 0, class<Actor> filter = "None", name species = "None");
|
||||
native void A_DamageSelf(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageTarget(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageMaster(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageTracer(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageChildren(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_DamageSiblings(int amount, name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillTarget(name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillMaster(name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillTracer(name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillChildren(name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_KillSiblings(name damagetype = "none", int flags = 0, class<Actor> filter = null, name species = "None", int src = AAPTR_DEFAULT, int inflict = AAPTR_DEFAULT);
|
||||
native void A_RemoveTarget(int flags = 0, class<Actor> filter = null, name species = "None");
|
||||
native void A_RemoveMaster(int flags = 0, class<Actor> filter = null, name species = "None");
|
||||
native void A_RemoveTracer(int flags = 0, class<Actor> filter = null, name species = "None");
|
||||
native void A_RemoveChildren(bool removeall = false, int flags = 0, class<Actor> filter = null, name species = "None");
|
||||
native void A_RemoveSiblings(bool removeall = false, int flags = 0, class<Actor> filter = null, name species = "None");
|
||||
native void A_Remove(int removee, int flags = 0, class<Actor> filter = null, name species = "None");
|
||||
native int A_GiveToChildren(class<Inventory> itemtype, int amount = 0);
|
||||
native int A_GiveToSiblings(class<Inventory> itemtype, int amount = 0);
|
||||
native int A_TakeFromChildren(class<Inventory> itemtype, int amount = 0);
|
||||
native int A_TakeFromSiblings(class<Inventory> itemtype, int amount = 0);
|
||||
native void A_SetTeleFog(class<Actor> oldpos, class<Actor> newpos);
|
||||
native void A_SwapTeleFog();
|
||||
native void A_SetFloatBobPhase(int bob);
|
||||
native void A_SetHealth(int health, int ptr = AAPTR_DEFAULT);
|
||||
native void A_ResetHealth(int ptr = AAPTR_DEFAULT);
|
||||
native state A_JumpIfHigherOrLower(state high, state low, float offsethigh = 0, float offsetlow = 0, bool includeHeight = true, int ptr = AAPTR_TARGET);
|
||||
native void A_SetSpecies(name species, int ptr = AAPTR_DEFAULT);
|
||||
native void A_SetRipperLevel(int level);
|
||||
native void A_SetRipMin(int mininum);
|
||||
native void A_SetRipMax(int maximum);
|
||||
native void A_SetChaseThreshold(int threshold, bool def = false, int ptr = AAPTR_DEFAULT);
|
||||
native state A_CheckProximity(state jump, class<Actor> classname, float distance, int count = 1, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
native state A_CheckBlock(state block, int flags = 0, int ptr = AAPTR_DEFAULT, float xofs = 0, float yofs = 0, float zofs = 0, float angle = 0);
|
||||
|
@ -348,8 +417,6 @@ class Actor : Thinker native
|
|||
native bool A_FaceMovementDirection(float offset = 0, float anglelimit = 0, float pitchlimit = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
native int A_ClearOverlays(int sstart = 0, int sstop = 0, bool safety = true);
|
||||
native bool A_CopySpriteFrame(int from, int to, int flags = 0);
|
||||
native bool A_SetSpriteAngle(float angle = 0, int ptr = AAPTR_DEFAULT);
|
||||
native bool A_SetSpriteRotation(float angle = 0, int ptr = AAPTR_DEFAULT);
|
||||
native bool A_SetVisibleRotation(float anglestart = 0, float angleend = 0, float pitchstart = 0, float pitchend = 0, int flags = 0, int ptr = AAPTR_DEFAULT);
|
||||
native void A_SetTranslation(string transname);
|
||||
|
||||
|
@ -362,13 +429,34 @@ class Actor : Thinker native
|
|||
action native void A_OverlayOffset(int layer = PSP_WEAPON, float wx = 0, float wy = 32, int flags = 0);
|
||||
action native void A_OverlayFlags(int layer, int flags, bool set);
|
||||
|
||||
native int ACS_NamedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0);
|
||||
native int ACS_NamedSuspend(name script, int mapnum=0);
|
||||
native int ACS_NamedTerminate(name script, int mapnum=0);
|
||||
native int ACS_NamedLockedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0);
|
||||
native int ACS_NamedLockedExecuteDoor(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0);
|
||||
native int ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0);
|
||||
native void ACS_NamedExecuteAlways(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0);
|
||||
int ACS_NamedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0)
|
||||
{
|
||||
return ACS_Execute(-int(script), mapnum, arg1, arg2, arg3);
|
||||
}
|
||||
int ACS_NamedSuspend(name script, int mapnum=0)
|
||||
{
|
||||
return ACS_Suspend(-int(script), mapnum);
|
||||
}
|
||||
int ACS_NamedTerminate(name script, int mapnum=0)
|
||||
{
|
||||
return ACS_Terminate(-int(script), mapnum);
|
||||
}
|
||||
int ACS_NamedLockedExecute(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0)
|
||||
{
|
||||
return ACS_LockedExecute(-int(script), mapnum, arg1, arg2, lock);
|
||||
}
|
||||
int ACS_NamedLockedExecuteDoor(name script, int mapnum=0, int arg1=0, int arg2=0, int lock=0)
|
||||
{
|
||||
return ACS_LockedExecuteDoor(-int(script), mapnum, arg1, arg2, lock);
|
||||
}
|
||||
int ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0)
|
||||
{
|
||||
return ACS_ExecuteWithResult(-int(script), arg1, arg2, arg3, arg4);
|
||||
}
|
||||
int ACS_NamedExecuteAlways(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0)
|
||||
{
|
||||
return ACS_ExecuteAlways(-int(script), mapnum, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
States
|
||||
{
|
||||
|
|
|
@ -479,7 +479,7 @@ class Gauntlets : Weapon
|
|||
GAUN A 1 A_Raise;
|
||||
Loop;
|
||||
Fire:
|
||||
GAUN B 4 A_PlayWeaponSound("weapons/gauntletsuse");
|
||||
GAUN B 4 A_PlaySound("weapons/gauntletsuse", CHAN_WEAPON);
|
||||
GAUN C 4;
|
||||
Hold:
|
||||
GAUN DEF 4 BRIGHT A_GauntletAttack(0);
|
||||
|
@ -512,7 +512,7 @@ class GauntletsPowered : Gauntlets
|
|||
GAUN G 1 A_Raise;
|
||||
Loop;
|
||||
Fire:
|
||||
GAUN J 4 A_PlayWeaponSound("weapons/gauntletsuse");
|
||||
GAUN J 4 A_PlaySound("weapons/gauntletsuse", CHAN_WEAPON);
|
||||
GAUN K 4;
|
||||
Hold:
|
||||
GAUN LMN 4 BRIGHT A_GauntletAttack(1);
|
||||
|
|
|
@ -52,7 +52,7 @@ class Wraith : Actor
|
|||
Missile:
|
||||
WRTH E 6 A_FaceTarget;
|
||||
WRTH F 6;
|
||||
WRTH G 6 A_CustomMissile("WraithFX1", 32, 0);
|
||||
WRTH G 6 A_CustomMissile("WraithFX1");
|
||||
Goto See;
|
||||
Death:
|
||||
WRTH I 4;
|
||||
|
|
Loading…
Reference in a new issue