forked from Mirrors/openclonk
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
parent
a12b5e5ad7
commit
ef515cc3c7
|
@ -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-><funclink>Message</funclink>("%s gets an extra life", Target-><funclink>GetName</funclink>());
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*--
|
||||
Action.c
|
||||
Authors: Günther
|
||||
|
||||
Authors: Günther
|
||||
|
||||
Stuff for the proplist changes.
|
||||
--*/
|
||||
|
||||
|
|
|
@ -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
|
||||
};
|
Loading…
Reference in New Issue