func FxPyritHammeringTimer(object c, proplist fx, int time) { if (FrameCounter() < this.anim_continue_frame || c.has_sequence) return FX_OK; this.anim = 0; if (!fx.catapult) if (!(fx.catapult = FindObject(Find_ID(Catapult), Sort_Distance()))) return FX_OK; if ((!Random(20) && GetPlayerCount()) || this.was_walk_interrupted) { // Move between two places (only if players are joined so Pyrit stays in place for object saving) var new_pos = [fx.catapult->GetX()-24, fx.catapult->GetX()+26][c->GetX() < fx.catapult->GetX()]; c->SetCommand("MoveTo", nil, new_pos, fx.catapult->GetY()); this.anim_continue_frame = FrameCounter() + 50; this.was_walk_interrupted = false; }
global func FxFireStart(object obj, int iNumber, int iTemp, int iCausedBy, bool fBlasted, object pIncineratingObject) { // Wenn ein Objekt zu brennen beginnt, gleich das Löschen planen var i; if (!iTemp) if (GetAlive(obj)) if (i=ObjectCount(_ETG)) { // Lösche in Schlüsselframes, damit nahe beieinanderliegende Objekte ungefähr gleichzeitig gelöscht werden // Dies verringert die Chance des Neuanzündens var iExtgTime = 200/i + 50 - (FrameCounter() % 50); AddEffect("IntExtinguisher", obj, 1, iExtgTime, obj); } return(inherited(obj, iNumber, iTemp, iCausedBy, fBlasted, pIncineratingObject)); }
// Generic call on every dlg message of Lara func Dlg_Lara(clonk) { // Stop walking. if (dlg_target->GetCommand()) { this.was_walk_interrupted = true; dlg_target->SetCommand("None"); dlg_target->SetComDir(COMD_Stop); dlg_target->SetXDir(); } // Yield activity this.anim_continue_frame = FrameCounter() + 50; return false; // do call specific functions }
// Generic call on every dlg message of Pyrit func Dlg_Pyrit(object clonk) { // Stop walking. if (dlg_target->GetCommand()) { this.was_walk_interrupted = true; dlg_target->SetCommand("None"); dlg_target->SetComDir(COMD_Stop); dlg_target->SetXDir(); } // Yield animation if (this.anim) dlg_target->StopAnimation(this.anim); this.anim = 0; this.anim_continue_frame = FrameCounter() + 50; return false; // do call specific functions }
func FxLaraWalkingTimer(object c, proplist fx, int time) { var speed_factor = 50; // Interrupted by dialogue? if (FrameCounter() < this.anim_continue_frame) return FX_OK; // No player joined? Stay in place for proper scenario saving. if (!GetPlayerCount()) return FX_OK; // Busy lifting/dropping? if (GetEffect("IntLiftHeavy", c)) return FX_OK; if (GetEffect("IntDropHeavy", c)) return FX_OK; // Do we have something to carry? if (!fx.carry_obj) { // Relax for a random time... if (!Random(10)) // ...and search new work after fx.carry_obj = fx.last_barrel = Lara_FindCarryObj(c, fx); } if (fx.carry_obj) { // need to pick it up? if (fx.carry_obj->Contained() != c) { // need to walk there? var dist = Abs(fx.carry_obj->GetX() - c->GetX()); if (dist < 10) { // pick up! c->SetCommand("None"); c->SetComDir(COMD_Stop); // short break - then pick up. if (c->GetXDir()) return FX_OK; c->SetXDir(); fx.carry_obj->Enter(c); // find a target fx.target_pos = [[220+Random(11), 311], [495+Random(51),358]][fx.carry_obj->GetX() < 350]; } else { // we're close. slow down. if (dist < 40) speed_factor = 30;