summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 016ff01)
raw | patch | inline | side by side (parent: 016ff01)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Sat, 12 Aug 2017 18:42:30 +0000 (21:42 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Sat, 12 Aug 2017 18:42:30 +0000 (21:42 +0300) |
src/game/g_monsters.pas | patch | blob | history | |
src/game/g_player.pas | patch | blob | history | |
src/game/g_weapons.pas | patch | blob | history |
index cc4926a3135a2a5a97cfa4a3e06e71907eea6008..e37e2e448b5115c204097f6c81c5467e5e01d5ae 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
FShellTimer: Integer;
FShellType: Byte;
FFirePainTime: Integer;
+ FFireAttacker: Word;
vilefire: TAnimation;
FDieTriggers: Array of Integer;
function AnimIsReverse: Boolean;
function shoot(o: PObj; immediately: Boolean): Boolean;
function kick(o: PObj): Boolean;
- procedure CatchFire();
+ procedure CatchFire(Attacker: Word);
procedure OnFireFlame(Times: DWORD = 1);
property MonsterType: Byte read FMonsterType;
FBehaviour := BH_NORMAL;
FFireTime := 0;
FFirePainTime := 0;
+ FFireAttacker := 0;
if FMonsterType in [MONSTER_ROBO, MONSTER_BARREL] then
FBloodKind := BLOOD_SPARKS
if (FState <> STATE_DIE) and (FState <> STATE_DEAD) then
if FFirePainTime = 0 then
begin
- Damage(5, 0, 0, 0, HIT_FLAME);
+ Damage(5, FFireAttacker, 0, 0, HIT_FLAME);
FFirePainTime := 18;
end
else
SetLength(FDieTriggers, 0);
end;
-procedure TMonster.CatchFire();
+procedure TMonster.CatchFire(Attacker: Word);
begin
- FFireTime := 360;
+ FFireTime := 100;
+ 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 a0496da85e63e8314c938bcea0aa18bd7a957495..050e0e650950b20e5e51a65d23f40564b87d3638 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
FXTo, FYTo: Integer;
FSpectatePlayer: Integer;
FFirePainTime: Integer;
+ FFireAttacker: Word;
FSavedState: TPlayerSavedState;
procedure RealizeCurrentWeapon();
procedure JetpackOn;
procedure JetpackOff;
- procedure CatchFire();
+ procedure CatchFire(Attacker: Word);
property Name: String read FName write FName;
property Model: TPlayerModel read FModel;
// WEAPON_CHAINGUN, WEAPON_SHOTGUN1, WEAPON_SAW,
// WEAPON_ROCKETLAUNCHER, WEAPON_PISTOL, WEAPON_KASTET);
WEAPON_RELOAD: Array [WP_FIRST..WP_LAST] of Byte =
- (5, 2, 6, 18, 36, 2, 12, 2, 14, 2, 0);
+ (5, 2, 6, 18, 36, 2, 12, 2, 14, 2, 2);
PLAYER_SIGNATURE = $52594C50; // 'PLYR'
CORPSE_SIGNATURE = $50524F43; // 'CORP'
FShellTimer := -1;
FFireTime := 0;
FFirePainTime := 0;
+ FFireAttacker := 0;
FActualModelName := 'doomer';
FJetSoundOff.PlayAt(FObj.X, FObj.Y);
end;
-procedure TPlayer.CatchFire();
+procedure TPlayer.CatchFire(Attacker: Word);
begin
- FFireTime := 360;
+ FFireTime := 100;
+ FFireAttacker := Attacker;
if g_Game_IsNet and g_Game_IsServer then
MH_SEND_PlayerStats(FUID);
end;
FDamageBuffer := 0;
FJetpack := False;
FCanJetpack := False;
+ FFireTime := 0;
+ FFirePainTime := 0;
+ FFireAttacker := 0;
// Àíèìàöèÿ âîçðîæäåíèÿ:
if (not gLoadGameMode) and (not Silent) then
if FFirePainTime <= 0 then
begin
if g_Game_IsServer then
- Damage(5, 0, 0, 0, HIT_FLAME);
+ Damage(5, FFireAttacker, 0, 0, HIT_FLAME);
FFirePainTime := 18;
end;
FFirePainTime := FFirePainTime - 1;
diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas
index 47de7ab9088588dea8be92a898179ae7c33bc7d5..0b82e18f5343b542edcb69bfeb0f908f2f889233 100644 (file)
--- a/src/game/g_weapons.pas
+++ b/src/game/g_weapons.pas
SHOT_FLAME_WIDTH = 4;
SHOT_FLAME_HEIGHT = 4;
- SHOT_FLAME_LIFETIME = 360;
+ SHOT_FLAME_LIFETIME = 180;
SHOT_SIGNATURE = $544F4853; // 'SHOT'
else
Result := True;
if t = HIT_FLAME then
- m.CatchFire();
+ m.CatchFire(SpawnerUID);
end
else
Result := True;
if (t <> HIT_FLAME) or (p.FFireTime = 0) or (vx <> 0) or (vy <> 0) then
p.Damage(d, SpawnerUID, vx, vy, t);
if (t = HIT_FLAME) then
- p.CatchFire();
+ p.CatchFire(SpawnerUID);
end;
Result := True;
Shots[i].Obj.Accel.Y := 0;
if Shots[i].ShotType in [WEAPON_ROCKETLAUNCHER, WEAPON_BFG] then
Shots[i].Timeout := 900 // ~25 sec
- else if Shots[i].ShotType = WEAPON_FLAMETHROWER then
- Shots[i].Timeout := SHOT_FLAME_LIFETIME
- else
- Shots[i].Timeout := 550 // ~15 sec
+ else
+ begin
+ if Shots[i].ShotType = WEAPON_FLAMETHROWER then
+ Shots[i].Timeout := SHOT_FLAME_LIFETIME
+ else
+ Shots[i].Timeout := 550; // ~15 sec
+ end;
end;
function g_Weapon_Hit(obj: PObj; d: Integer; SpawnerUID: Word; t: Byte; HitCorpses: Boolean = True): Byte;
dx := IfThen(xd > x, -Obj.Rect.Width, 0);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_ROCKETLAUNCHER;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 12);
Animation := nil;
triggers := nil;
- ShotType := WEAPON_ROCKETLAUNCHER;
g_Texture_Get('TEXTURE_WEAPON_ROCKET', TextureID);
end;
dx := -(Obj.Rect.Width div 2);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_SKEL_FIRE;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 12);
triggers := nil;
- ShotType := WEAPON_SKEL_FIRE;
target := TargetUID;
g_Frames_Get(FramesID, 'FRAMES_WEAPON_SKELFIRE');
Animation := TAnimation.Create(FramesID, True, 5);
dx := IfThen(xd>x, -Obj.Rect.Width, 0);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_PLASMA;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- ShotType := WEAPON_PLASMA;
g_Frames_Get(FramesID, 'FRAMES_WEAPON_PLASMA');
Animation := TAnimation.Create(FramesID, True, 5);
end;
dx := IfThen(xd>x, -Obj.Rect.Width, 0);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_FLAMETHROWER;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- ShotType := WEAPON_FLAMETHROWER;
Animation := nil;
TextureID := 0;
Stopped := 0;
dx := IfThen(xd>x, -Obj.Rect.Width, 0);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_IMP_FIRE;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- ShotType := WEAPON_IMP_FIRE;
g_Frames_Get(FramesID, 'FRAMES_WEAPON_IMPFIRE');
Animation := TAnimation.Create(FramesID, True, 4);
end;
dx := IfThen(xd>x, -Obj.Rect.Width, 0);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_CACO_FIRE;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- ShotType := WEAPON_CACO_FIRE;
g_Frames_Get(FramesID, 'FRAMES_WEAPON_CACOFIRE');
Animation := TAnimation.Create(FramesID, True, 4);
end;
dx := IfThen(xd>x, -Obj.Rect.Width, 0);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_BARON_FIRE;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- ShotType := WEAPON_BARON_FIRE;
g_Frames_Get(FramesID, 'FRAMES_WEAPON_BARONFIRE');
Animation := TAnimation.Create(FramesID, True, 4);
end;
dx := IfThen(xd>x, -Obj.Rect.Width, 0);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_BSP_FIRE;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- ShotType := WEAPON_BSP_FIRE;
+
g_Frames_Get(FramesID, 'FRAMES_WEAPON_BSPFIRE');
Animation := TAnimation.Create(FramesID, True, 4);
end;
dx := IfThen(xd>x, -Obj.Rect.Width, 0);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_MANCUB_FIRE;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- ShotType := WEAPON_MANCUB_FIRE;
+
g_Frames_Get(FramesID, 'FRAMES_WEAPON_MANCUBFIRE');
Animation := TAnimation.Create(FramesID, True, 4);
end;
dx := IfThen(xd>x, -Obj.Rect.Width, 0);
dy := -(Obj.Rect.Height div 2);
+
+ ShotType := WEAPON_BFG;
throw(find_id, x+dx, y+dy, xd+dx, yd+dy, 16);
triggers := nil;
- ShotType := WEAPON_BFG;
g_Frames_Get(FramesID, 'FRAMES_WEAPON_BFG');
Animation := TAnimation.Create(FramesID, True, 6);
end;
ShotType := 0;
end;
- if g_Frames_Get(_id, 'FRAMES_FLAME') then
+ if g_Frames_Get(_id, 'FRAMES_FLAME') and (gTime mod 2 = 0) then
begin
Anim := TAnimation.Create(_id, False, 2 + Random(2));
Anim.Alpha := 0;