summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 040b89b)
raw | patch | inline | side by side (parent: 040b89b)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Fri, 9 Aug 2019 00:28:13 +0000 (03:28 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Fri, 9 Aug 2019 00:28:13 +0000 (03:28 +0300) |
src/game/g_monsters.pas | patch | blob | history | |
src/game/g_player.pas | patch | blob | history |
index 83714cbdd0ec333d5f9a581bfd35c78aae655fd5..02bea1f632bb906c89b5b56a220b757ec2d1b484 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
MONSTATE_REVIVE = 10;
MONSTATE_RUNOUT = 11;
+ MON_BURN_TIME = 100;
+
{ in mapdef now
BH_NORMAL = 0;
BH_KILLER = 1;
function AnimIsReverse: Boolean;
function shoot(o: PObj; immediately: Boolean): Boolean;
function kick(o: PObj): Boolean;
- procedure CatchFire(Attacker: Word);
+ procedure CatchFire(Attacker: Word; Timeout: Integer = MON_BURN_TIME);
procedure OnFireFlame(Times: DWORD = 1);
procedure positionChanged (); //WARNING! call this after monster position was changed, or coldet will not work right!
st := g_Obj_Move(@FObj, fall, True, True);
positionChanged(); // this updates spatial accelerators
-// Åñëè ãîðèì - ïîäæèãàåì äðóãèõ ìîíñòðîâ:
+// Åñëè ãîðèì - ïîäæèãàåì äðóãèõ ìîíñòðîâ, íî íå íà 100 òèêîâ êàæäûé ðàç:
if FFireTime > 0 then
for a := 0 to High(gMonsters) do
if (gMonsters[a] <> nil) and (gMonsters[a].alive) and
(gMonsters[a].FUID <> FUID) and
g_Obj_Collide(@FObj, @gMonsters[a].Obj) then
- gMonsters[a].CatchFire(FFireAttacker);
+ gMonsters[a].CatchFire(FFireAttacker, FFireTime);
// Âûëåòåë çà êàðòó - óäàëÿåì è çàïóñêàåì òðèããåðû:
if WordBool(st and MOVE_FALLOUT) or (FObj.X < -1000) or
SetLength(FDieTriggers, 0);
end;
-procedure TMonster.CatchFire(Attacker: Word);
+procedure TMonster.CatchFire(Attacker: Word; Timeout: Integer = MON_BURN_TIME);
begin
+ if Timeout <= 0 then exit;
if FFireTime <= 0 then
g_Sound_PlayExAt('SOUND_IGNITE', FObj.X, FObj.Y);
- FFireTime := 100;
+ FFireTime := Timeout;
FFireAttacker := Attacker;
if g_Game_IsNet and g_Game_IsServer then MH_SEND_MonsterState(FUID);
end;
diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 3549b11b2b5b56a036d448b2939bd7a01787b194..b99c03dd7533081b58204981872a584b8f55a46a 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
SUICIDE_DAMAGE = 112;
WEAPON_DELAY = 5;
+ PLAYER_BURN_TIME = 110;
+
PLAYER1_DEF_COLOR: TRGB = (R:64; G:175; B:48);
PLAYER2_DEF_COLOR: TRGB = (R:96; G:96; B:96);
procedure FlamerOff;
procedure JetpackOn;
procedure JetpackOff;
- procedure CatchFire(Attacker: Word);
+ procedure CatchFire(Attacker: Word; Timeout: Integer = PLAYER_BURN_TIME);
//WARNING! this does nothing for now, but still call it!
procedure positionChanged (); //WARNING! call this after entity position was changed, or coldet will not work right!
FJetSoundOff.PlayAt(FObj.X, FObj.Y);
end;
-procedure TPlayer.CatchFire(Attacker: Word);
+procedure TPlayer.CatchFire(Attacker: Word; Timeout: Integer = PLAYER_BURN_TIME);
begin
+ if Timeout <= 0 then
+ exit;
if (FMegaRulez[MR_SUIT] > gTime) or (FMegaRulez[MR_INVUL] > gTime) then
exit; // Íå çàãîðàåìñÿ êîãäà åñòü çàùèòà
if FFireTime <= 0 then
g_Sound_PlayExAt('SOUND_IGNITE', FObj.X, FObj.Y);
- FFireTime := 110;
+ FFireTime := Timeout;
FFireAttacker := Attacker;
if g_Game_IsNet and g_Game_IsServer then
MH_SEND_PlayerStats(FUID);