Script: Prototypes for CreateEffect should inherit from Effect

This makes the special effect properties useable without the "this." prefix,
makes the various useful global functions available as well as
effect-specific functions.
qteditor
Günther Brammer 2016-05-15 15:13:19 +02:00
parent a12b5e5ad7
commit ef515cc3c7
3 changed files with 24 additions and 6 deletions

View File

@ -70,8 +70,7 @@ func Activate(object caster, object caster2)
return true;
}
local InvisPSpell =
{
local InvisPSpell = new Effect {
Start = func() {
// Save the casters previous visibility
this.visibility = Target.Visibility;
@ -113,7 +112,7 @@ func Activate(object caster, object caster2)
return true;
}
local BanBurnPSpell = {
local BanBurnPSpell = new Effect {
Construction = func()
{
// On start of the effect: extinguish clonk
@ -217,7 +216,7 @@ func Activate(object caster, object caster2)
return true;
}
local ReincarnationPSpell = {
local ReincarnationPSpell = new Effect {
Construction = func() {
// Only at the first start: message
Target-&gt;<funclink>Message</funclink>(&quot;%s gets an extra life&quot;, Target-&gt;<funclink>GetName</funclink>());

View File

@ -1,7 +1,7 @@
/*--
Action.c
Authors: Günther
Authors: Günther
Stuff for the proplist changes.
--*/

View File

@ -0,0 +1,19 @@
/*--
Effect.c
Authors: Günther
Prototype for effect prototypes.
--*/
static const Effect = new Global {
Remove = func(bool no_calls) {
return RemoveEffect(nil, nil, this, no_calls);
},
// These properties are set on all effects by the engine.
// They are declared here so that functions on proplists inheriting from this one can use them easily.
Name = nil,
Priority = 0,
Interval = 0,
Target = nil,
Time = 0
};