X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_monsters.pas;h=834220a1b40d316a4634bfc93f432739c077f860;hb=2e74c901511298e44d168948d85e9cff009fcb7e;hp=71619512a3648a3d69e88eb390f5a5f2f8941a20;hpb=9785609d62537953358024080b20ed999a66e751;p=d2df-sdl.git diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index 7161951..834220a 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -91,6 +91,8 @@ type mNeedSend: Boolean; // for network + mEDamageType: Integer; + procedure Turn(); function findNewPrey(): Boolean; procedure ActivateTriggers(); @@ -98,6 +100,8 @@ type procedure setGameX (v: Integer); inline; procedure setGameY (v: Integer); inline; + procedure doDamage (v: Integer); + public FNoRespawn: Boolean; FFireTime: Integer; @@ -158,7 +162,6 @@ type property proxyId: Integer read mProxyId; property arrIdx: Integer read mArrIdx; - published property MonsterType: Byte read FMonsterType; property MonsterHealth: Integer read FHealth write FHealth; property MonsterAmmo: Integer read FAmmo write FAmmo; @@ -183,6 +186,36 @@ type property GameDirection: TDirection read FDirection write FDirection; property StartID: Integer read FStartID; + + published + property eMonsterType: Byte read FMonsterType; + property eMonsterHealth: Integer read FHealth write FHealth; + property eMonsterAmmo: Integer read FAmmo write FAmmo; + property eMonsterTargetUID: Word read FTargetUID write FTargetUID; + property eMonsterTargetTime: Integer read FTargetTime write FTargetTime; + property eMonsterBehaviour: Byte read FBehaviour write FBehaviour; + property eMonsterSleep: Integer read FSleep write FSleep; + property eMonsterState: Byte read FState write FState; + property eMonsterRemoved: Boolean read FRemoved; + property eMonsterPain: Integer read FPain write FPain; + property eMonsterAnim: Byte read FCurAnim; + + property eUID: Word read FUID; + property eSpawnTrigger: Integer read FSpawnTrigger; + + property eGameX: Integer read FObj.X write setGameX; + property eGameY: Integer read FObj.Y write setGameY; + property eGameVelX: Integer read FObj.Vel.X write FObj.Vel.X; + property eGameVelY: Integer read FObj.Vel.Y write FObj.Vel.Y; + property eGameAccelX: Integer read FObj.Accel.X write FObj.Accel.X; + property eGameAccelY: Integer read FObj.Accel.Y write FObj.Accel.Y; + property eGameDirection: TDirection read FDirection write FDirection; + + property eStartID: Integer read FStartID; + + // set this before assigning something to `eDamage` + property eDamageType: Integer read mEDamageType write mEDamageType; + property eDamage: Integer write doDamage; end; @@ -1587,6 +1620,12 @@ begin end; end; +procedure TMonster.doDamage (v: Integer); +begin + if (v <= 0) then exit; + if (v > 32767) then v := 32767; + Damage(v, 0, 0, 0, mEDamageType); +end; procedure TMonster.ActionSound(); begin @@ -1833,6 +1872,7 @@ begin FFireTime := 0; FFirePainTime := 0; FFireAttacker := 0; + mEDamageType := HIT_SOME; mProxyId := -1; mArrIdx := -1;