- scriptified Strife's coins.

- added a String class to allow attaching methods to the builtin string type. This works by checking if the left side of the member accessor is a string and just replacing the tyoe in this one place, all the rest is automatic.
This commit is contained in:
Christoph Oelckers 2016-11-28 18:15:18 +01:00
commit 9064a5b0ac
17 changed files with 222 additions and 34 deletions

View file

@ -919,6 +919,27 @@ AInventory *AInventory::CreateTossable ()
return copy;
}
DEFINE_ACTION_FUNCTION(AInventory, CreateTossable)
{
PARAM_SELF_PROLOGUE(AInventory);
ACTION_RETURN_OBJECT(self->CreateTossable());
}
AInventory *AInventory::CallCreateTossable()
{
IFVIRTUAL(AInventory, CreateTossable)
{
VMValue params[1] = { (DObject*)this };
VMReturn ret;
VMFrameStack stack;
AInventory *retval;
ret.PointerAt((void**)&retval);
stack.Call(func, params, 1, &ret, 1, nullptr);
return retval;
}
else return CreateTossable();
}
//===========================================================================
//
// AInventory :: BecomeItem
@ -946,6 +967,13 @@ void AInventory::BecomeItem ()
SetState (FindState("Held"));
}
DEFINE_ACTION_FUNCTION(AInventory, BecomeItem)
{
PARAM_SELF_PROLOGUE(AInventory);
self->BecomeItem();
return 0;
}
//===========================================================================
//
// AInventory :: BecomePickup
@ -973,6 +1001,13 @@ void AInventory::BecomePickup ()
SetState (SpawnState);
}
DEFINE_ACTION_FUNCTION(AInventory, BecomePickup)
{
PARAM_SELF_PROLOGUE(AInventory);
self->BecomePickup();
return 0;
}
//===========================================================================
//
// AInventory :: AbsorbDamage