Fixed gravestone rule and added it to the arenas

Maikel de Vries 2012-10-22 20:05:23 +02:00
parent 5663bd2c4d
commit be410432a8
9 changed files with 52 additions and 27 deletions

View File

@ -21,6 +21,7 @@ protected func Initialize()
CreateObject(Rule_Restart);
CreateObject(Rule_ObjectFade)->DoFadeTime(5 * 36);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
var lwidth = LandscapeWidth();

View File

@ -17,6 +17,7 @@ protected func Initialize()
// Objects fade after 7 seconds.
CreateObject(Rule_ObjectFade)->DoFadeTime(7 * 36);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//make lava collapse
CreateObject(Firestone,625,480);

View File

@ -12,6 +12,7 @@ protected func Initialize()
// Goal.
CreateObject(Goal_LastManStanding);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//Enviroment.
Cloud->Place(25);

View File

@ -11,6 +11,7 @@ protected func Initialize()
// Goal.
CreateObject(Goal_LastManStanding, 0, 0, NO_OWNER);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
// Chests with weapons.
CreateObject(Chest, 108, 248, NO_OWNER)->MakeInvincible();

View File

@ -12,6 +12,7 @@ protected func Initialize()
// Goal.
CreateObject(Goal_LastManStanding, 0, 0, NO_OWNER);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
// Mood.
SetSkyAdjust(RGBa(255, 255, 255, 127), RGB(255, 200, 150));

View File

@ -14,6 +14,7 @@ protected func Initialize()
// Goal.
CreateObject(Goal_DeathMatch, 0, 0, NO_OWNER);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//Enviroment.
CreateObject(Rule_ObjectFade)->DoFadeTime(10 * 36);

View File

@ -16,6 +16,7 @@ protected func Initialize()
goal->SetPointLimit(5);
AddEffect("BlessTheKing",goal,100,1,nil);
CreateObject(Rule_KillLogs);
CreateObject(Rule_Gravestones);
//Enviroment.
//SetSkyAdjust(RGBa(250,250,255,128),RGB(200,200,220));

View File

@ -153,37 +153,10 @@ protected func Death(int killed_by)
Sound("FDie");
CloseEyes(1);
//Are gravestones used in the scenario?
if(FindObject(Find_ID(Rule_Gravestones)))
AddEffect("GravestoneAdd", this, 1, 1, this);
DeathAnnounce();
return;
}
func FxGravestoneAddTimer(object target, proplist effect, int timer)
{
//is the death animation over?
if(timer >= 20){
AddEffect("Gravestone",this, 1, nil, this);
return -1;
}
}
func FxGravestoneStart(object clonk, proplist effect){
effect.grave = CreateObject(Clonk_Grave,0,0,clonk->GetController());
this->Enter(effect.grave);
//smoke effect
CastParticles("ExploSmoke", RandomX(10,15), 0, 0, 6, 200, 250, HSLa(0,0,255,64), HSLa(0,0,255,64));
}
func FxGravestoneStop(object clonk, proplist effect){
clonk->Exit();
effect.grave->RemoveObject();
}
protected func Destruction()
{
_inherited(...);

View File

@ -1,5 +1,50 @@
/*-- Gravestones --*/
protected func Initialize()
{
// Under no circumstance there may by multiple copies of this rule.
if (ObjectCount(Find_ID(Rule_TeamAccount)) > 1)
return RemoveObject();
return;
}
public func OnClonkDeath(object clonk)
{
if (!clonk->GetAlive())
AddEffect("AddGravestone", clonk, 1, 1, this);
return;
}
public func FxAddGravestoneTimer(object target, proplist effect, int timer)
{
// Wait for the death animation to be over.
if (timer >= 20)
{
AddEffect("IntGravestone", target, 1, nil, this);
return -1;
}
}
public func FxIntGravestoneStart(object clonk, proplist effect)
{
effect.grave = clonk->CreateObject(Clonk_Grave, 0, 0, clonk->GetController());
clonk->Enter(effect.grave);
//smoke effect
effect.grave->CastParticles("ExploSmoke", RandomX(10,15), 0, 0, 6, 200, 250, HSLa(0,0,255,64), HSLa(0,0,255,64));
}
public func FxIntGravestoneStop(object clonk, proplist effect, int reason)
{
if (reason != FX_Call_RemoveClear)
{
clonk->Exit();
effect.grave->RemoveObject();
}
}
protected func Activate(int iByPlayer)
{
MessageWindow(GetProperty("Description"), iByPlayer);