X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2Fmapdef_impl.inc;h=14723af4508795d703c472711a0d8898993787db;hb=08095f30d97fe8ca473173173df6158aa352f64a;hp=f491dbf3686c71e138fcc8ac56b40e36e3746189;hpb=923fa980434e55419f35422119af2faae2bf68d7;p=d2df-sdl.git diff --git a/src/shared/mapdef_impl.inc b/src/shared/mapdef_impl.inc index f491dbf..14723af 100644 --- a/src/shared/mapdef_impl.inc +++ b/src/shared/mapdef_impl.inc @@ -4,17 +4,15 @@ // trigger helpers // TRIGGER_EXIT -function TDynRecordHelper.trigMapName (): AnsiString; inline; begin result := utf2win(getFieldWithType('map', TDynField.TType.TChar).sval); end; +function TDynRecordHelper.trigMap (): AnsiString; inline; begin result := utf2win(getFieldWithType('map', TDynField.TType.TChar).sval); end; // TRIGGER_TELEPORT -function TDynRecordHelper.trigTargetPoint (): TDFPoint; inline; begin result := getPointField('target'); end; -function TDynRecordHelper.trigd2d_teleport (): Boolean; inline; begin result := (getFieldWithType('d2d', TDynField.TType.TBool).ival <> 0); end; -function TDynRecordHelper.trigsilent_teleport (): Boolean; inline; begin result := (getFieldWithType('silent', TDynField.TType.TBool).ival <> 0); end; -function TDynRecordHelper.trigTlpDir (): Byte; inline; begin result := Byte(getFieldWithType('direction', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigTarget (): TDFPoint; inline; begin result := getPointField('target'); end; +function TDynRecordHelper.trigD2d (): Boolean; inline; begin result := (getFieldWithType('d2d', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigSilent (): Boolean; inline; begin result := (getFieldWithType('silent', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigDirection (): Byte; inline; begin result := Byte(getFieldWithType('direction', TDynField.TType.TUByte).ival); end; // TRIGGER_OPENDOOR, TRIGGER_CLOSEDOOR, TRIGGER_DOOR, TRIGGER_DOOR5, TRIGGER_CLOSETRAP, TRIGGER_TRAP, TRIGGER_LIFTUP, TRIGGER_LIFTDOWN, TRIGGER_LIFT -function TDynRecordHelper.trigNoSound (): Boolean; inline; begin result := (getFieldWithType('silent', TDynField.TType.TBool).ival <> 0); end; -function TDynRecordHelper.trigd2d_doors (): Boolean; inline; begin result := (getFieldWithType('d2d', TDynField.TType.TBool).ival <> 0); end; // TRIGGER_PRESS, TRIGGER_ON, TRIGGER_OFF, TRIGGER_ONOFF function TDynRecordHelper.trigTX (): LongInt; inline; begin result := LongInt(getFieldWithType('position', TDynField.TType.TPoint).ival); end; @@ -22,53 +20,48 @@ function TDynRecordHelper.trigTY (): LongInt; inline; begin result := LongInt(ge function TDynRecordHelper.trigTWidth (): Word; inline; begin result := Word(getFieldWithType('size', TDynField.TType.TSize).ival); end; function TDynRecordHelper.trigTHeight (): Word; inline; begin result := Word(getFieldWithType('size', TDynField.TType.TSize).ival2); end; function TDynRecordHelper.trigWait (): Word; inline; begin result := Word(getFieldWithType('wait', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigCount (): Word; inline; begin result := Word(getFieldWithType('count', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigExtRandom (): Boolean; inline; begin result := (getFieldWithType('extrandom', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigPressCount (): Word; inline; begin result := Word(getFieldWithType('count', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigExtRandom (): Boolean; inline; begin result := (getFieldWithType('ext_random', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigSound (): AnsiString; inline; begin result := utf2win(getFieldWithType('sound', TDynField.TType.TString).sval); end; // TRIGGER_SECRET // TRIGGER_TEXTURE -function TDynRecordHelper.trigActivateOnce (): Boolean; inline; begin result := (getFieldWithType('activateonce', TDynField.TType.TBool).ival <> 0); end; -function TDynRecordHelper.trigAnimOnce (): Boolean; inline; begin result := (getFieldWithType('animateonce', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigActivateOnce (): Boolean; inline; begin result := (getFieldWithType('activate_once', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigAnimateOnce (): Boolean; inline; begin result := (getFieldWithType('animate_once', TDynField.TType.TBool).ival <> 0); end; // TRIGGER_SOUND -function TDynRecordHelper.trigSoundName (): AnsiString; inline; begin result := utf2win(getFieldWithType('soundname', TDynField.TType.TChar).sval); end; +function TDynRecordHelper.trigSoundName (): AnsiString; inline; begin result := utf2win(getFieldWithType('sound_name', TDynField.TType.TChar).sval); end; function TDynRecordHelper.trigVolume (): Byte; inline; begin result := Byte(getFieldWithType('volume', TDynField.TType.TUByte).ival); end; function TDynRecordHelper.trigPan (): Byte; inline; begin result := Byte(getFieldWithType('pan', TDynField.TType.TUByte).ival); end; function TDynRecordHelper.trigLocal (): Boolean; inline; begin result := (getFieldWithType('local', TDynField.TType.TBool).ival <> 0); end; -function TDynRecordHelper.trigPlayCount (): Byte; inline; begin result := Byte(getFieldWithType('playcount', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigSoundSwitch (): Boolean; inline; begin result := (getFieldWithType('soundswitch', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigPlayCount (): Byte; inline; begin result := Byte(getFieldWithType('play_count', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigSoundSwitch (): Boolean; inline; begin result := (getFieldWithType('sound_switch', TDynField.TType.TBool).ival <> 0); end; // TRIGGER_SPAWNMONSTER -function TDynRecordHelper.trigMonPos (): TDFPoint; inline; begin result := getPointField('position'); end; -function TDynRecordHelper.trigMonType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigMonHealth (): LongInt; inline; begin result := LongInt(getFieldWithType('health', TDynField.TType.TInt).ival); end; -function TDynRecordHelper.trigMonDir (): Byte; inline; begin result := Byte(getFieldWithType('direction', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigMonActive (): Boolean; inline; begin result := (getFieldWithType('active', TDynField.TType.TBool).ival <> 0); end; -function TDynRecordHelper.trigMonCount (): LongInt; inline; begin result := LongInt(getFieldWithType('count', TDynField.TType.TInt).ival); end; -function TDynRecordHelper.trigMonEffect (): Byte; inline; begin result := Byte(getFieldWithType('effect', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigMonMax (): Word; inline; begin result := Word(getFieldWithType('max', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigMonDelay (): Word; inline; begin result := Word(getFieldWithType('delay', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigMonBehav (): Byte; inline; begin result := Byte(getFieldWithType('behaviour', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigSpawnMonsType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigHealth (): LongInt; inline; begin result := LongInt(getFieldWithType('health', TDynField.TType.TInt).ival); end; +function TDynRecordHelper.trigActive (): Boolean; inline; begin result := (getFieldWithType('active', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigMonsCount (): LongInt; inline; begin result := LongInt(getFieldWithType('count', TDynField.TType.TInt).ival); end; +function TDynRecordHelper.trigEffect (): Byte; inline; begin result := Byte(getFieldWithType('effect', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigMax (): Word; inline; begin result := Word(getFieldWithType('max', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigDelay (): Word; inline; begin result := Word(getFieldWithType('delay', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigBehaviour (): Byte; inline; begin result := Byte(getFieldWithType('behaviour', TDynField.TType.TUByte).ival); end; // TRIGGER_SPAWNITEM -function TDynRecordHelper.trigItemPos (): TDFPoint; inline; begin result := getPointField('position'); end; -function TDynRecordHelper.trigItemType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigItemFalls (): Boolean; inline; begin result := (getFieldWithType('gravity', TDynField.TType.TBool).ival <> 0); end; -function TDynRecordHelper.trigItemOnlyDM (): Boolean; inline; begin result := (getFieldWithType('dmonly', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigSpawnItemType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigGravity (): Boolean; inline; begin result := (getFieldWithType('gravity', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigDmonly (): Boolean; inline; begin result := (getFieldWithType('dmonly', TDynField.TType.TBool).ival <> 0); end; function TDynRecordHelper.trigItemCount (): LongInt; inline; begin result := LongInt(getFieldWithType('count', TDynField.TType.TInt).ival); end; -function TDynRecordHelper.trigItemEffect (): Byte; inline; begin result := Byte(getFieldWithType('effect', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigItemMax (): Word; inline; begin result := Word(getFieldWithType('max', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigItemDelay (): Word; inline; begin result := Word(getFieldWithType('delay', TDynField.TType.TUShort).ival); end; // TRIGGER_MUSIC function TDynRecordHelper.trigMusicName (): AnsiString; inline; begin result := utf2win(getFieldWithType('name', TDynField.TType.TChar).sval); end; function TDynRecordHelper.trigMusicAction (): Byte; inline; begin result := Byte(getFieldWithType('action', TDynField.TType.TUByte).ival); end; // TRIGGER_PUSH -function TDynRecordHelper.trigPushAngle (): Word; inline; begin result := Word(getFieldWithType('angle', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigPushForce (): Byte; inline; begin result := Byte(getFieldWithType('force', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigResetVel (): Boolean; inline; begin result := (getFieldWithType('resetvelocity', TDynField.TType.TBool).ival <> 0); end; +function TDynRecordHelper.trigAngle (): Word; inline; begin result := Word(getFieldWithType('angle', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigForce (): Byte; inline; begin result := Byte(getFieldWithType('force', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigResetVelocity (): Boolean; inline; begin result := (getFieldWithType('reset_velocity', TDynField.TType.TBool).ival <> 0); end; // TRIGGER_SCORE function TDynRecordHelper.trigScoreAction (): Byte; inline; begin result := Byte(getFieldWithType('action', TDynField.TType.TUByte).ival); end; @@ -78,46 +71,39 @@ function TDynRecordHelper.trigScoreCon (): Boolean; inline; begin result := (get function TDynRecordHelper.trigScoreMsg (): Boolean; inline; begin result := (getFieldWithType('message', TDynField.TType.TBool).ival <> 0); end; // TRIGGER_MESSAGE -function TDynRecordHelper.trigMessageKind (): Byte; inline; begin result := Byte(getFieldWithType('kind', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigMessageSendTo (): Byte; inline; begin result := Byte(getFieldWithType('sendto', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigMessageText (): AnsiString; inline; begin result := utf2win(getFieldWithType('text', TDynField.TType.TChar).sval); end; -function TDynRecordHelper.trigMessageTime (): Word; inline; begin result := Word(getFieldWithType('time', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigKind (): Byte; inline; begin result := Byte(getFieldWithType('kind', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigMsgDest (): Byte; inline; begin result := Byte(getFieldWithType('dest', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigText (): AnsiString; inline; begin result := utf2win(getFieldWithType('text', TDynField.TType.TChar).sval); end; +function TDynRecordHelper.trigMsgTime (): Word; inline; begin result := Word(getFieldWithType('time', TDynField.TType.TUShort).ival); end; // TRIGGER_DAMAGE -function TDynRecordHelper.trigDamageValue (): Word; inline; begin result := Word(getFieldWithType('amount', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigDamageInterval (): Word; inline; begin result := Word(getFieldWithType('interval', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigAmount (): Word; inline; begin result := Word(getFieldWithType('amount', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigInterval (): Word; inline; begin result := Word(getFieldWithType('interval', TDynField.TType.TUShort).ival); end; // TRIGGER_HEALTH -function TDynRecordHelper.trigHealValue (): Word; inline; begin result := Word(getFieldWithType('amount', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigHealInterval (): Word; inline; begin result := Word(getFieldWithType('interval', TDynField.TType.TUShort).ival); end; function TDynRecordHelper.trigHealMax (): Boolean; inline; begin result := (getFieldWithType('max', TDynField.TType.TBool).ival <> 0); end; -function TDynRecordHelper.trigHealSilent (): Boolean; inline; begin result := (getFieldWithType('silent', TDynField.TType.TBool).ival <> 0); end; // TRIGGER_SHOT -function TDynRecordHelper.trigShotPos (): TDFPoint; inline; begin result := getPointField('position'); end; function TDynRecordHelper.trigShotType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end; function TDynRecordHelper.trigShotTarget (): Byte; inline; begin result := Byte(getFieldWithType('target', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigShotSound (): Boolean; inline; begin result := (getFieldWithType('silent', TDynField.TType.TBool).ival = 0); end; -function TDynRecordHelper.trigShotAim (): SmallInt; inline; begin result := ShortInt(getFieldWithType('aim', TDynField.TType.TByte).ival); end; -function TDynRecordHelper.trigShotIntSight (): Word; inline; begin result := Word(getFieldWithType('sight', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigShotAngle (): Word; inline; begin result := Word(getFieldWithType('angle', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigShotWait (): Word; inline; begin result := Word(getFieldWithType('wait', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigShotAccuracy (): Word; inline; begin result := Word(getFieldWithType('accuracy', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigShotAmmo (): Word; inline; begin result := Word(getFieldWithType('ammo', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigShotIntReload (): Word; inline; begin result := Word(getFieldWithType('reload', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigShotSound (): Boolean; inline; begin result := (getFieldWithType('sound', TDynField.TType.TBool).ival = 0); end; +function TDynRecordHelper.trigAim (): SmallInt; inline; begin result := ShortInt(getFieldWithType('aim', TDynField.TType.TByte).ival); end; +function TDynRecordHelper.trigSight (): Word; inline; begin result := Word(getFieldWithType('sight', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigAccuracy (): Word; inline; begin result := Word(getFieldWithType('accuracy', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigAmmo (): Word; inline; begin result := Word(getFieldWithType('ammo', TDynField.TType.TUShort).ival); end; +function TDynRecordHelper.trigReload (): Word; inline; begin result := Word(getFieldWithType('reload', TDynField.TType.TUShort).ival); end; // TRIGGER_EFFECT function TDynRecordHelper.trigFXCount (): Byte; inline; begin result := Byte(getFieldWithType('count', TDynField.TType.TUByte).ival); end; function TDynRecordHelper.trigFXType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end; function TDynRecordHelper.trigFXSubType (): Byte; inline; begin result := Byte(getFieldWithType('subtype', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigFXColorR (): Byte; inline; begin result := Byte(getFieldWithType('colorr', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigFXColorG (): Byte; inline; begin result := Byte(getFieldWithType('colorg', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigFXColorB (): Byte; inline; begin result := Byte(getFieldWithType('colorb', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigFXPos (): Byte; inline; begin result := Byte(getFieldWithType('position', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigFXWait (): Word; inline; begin result := Word(getFieldWithType('wait', TDynField.TType.TUShort).ival); end; -function TDynRecordHelper.trigFXVelX (): SmallInt; inline; begin result := ShortInt(getFieldWithType('velx', TDynField.TType.TByte).ival); end; -function TDynRecordHelper.trigFXVelY (): SmallInt; inline; begin result := ShortInt(getFieldWithType('vely', TDynField.TType.TByte).ival); end; -function TDynRecordHelper.trigFXSpreadL (): Byte; inline; begin result := Byte(getFieldWithType('spreadl', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigFXSpreadR (): Byte; inline; begin result := Byte(getFieldWithType('spreadr', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigFXSpreadU (): Byte; inline; begin result := Byte(getFieldWithType('spreadu', TDynField.TType.TUByte).ival); end; -function TDynRecordHelper.trigFXSpreadD (): Byte; inline; begin result := Byte(getFieldWithType('spreadd', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigFXRed (): Byte; inline; begin result := Byte(getFieldWithType('red', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigFXGreen (): Byte; inline; begin result := Byte(getFieldWithType('green', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigFXBlue (): Byte; inline; begin result := Byte(getFieldWithType('blue', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigFXPos (): Byte; inline; begin result := Byte(getFieldWithType('pos', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigVelX (): SmallInt; inline; begin result := ShortInt(getFieldWithType('vel_x', TDynField.TType.TByte).ival); end; +function TDynRecordHelper.trigVelY (): SmallInt; inline; begin result := ShortInt(getFieldWithType('vel_y', TDynField.TType.TByte).ival); end; +function TDynRecordHelper.trigSpreadL (): Byte; inline; begin result := Byte(getFieldWithType('spread_l', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigSpreadR (): Byte; inline; begin result := Byte(getFieldWithType('spread_r', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigSpreadU (): Byte; inline; begin result := Byte(getFieldWithType('spread_u', TDynField.TType.TUByte).ival); end; +function TDynRecordHelper.trigSpreadD (): Byte; inline; begin result := Byte(getFieldWithType('spread_d', TDynField.TType.TUByte).ival); end;