DEADSOFTWARE

fix screen size saving after first start
[d2df-sdl.git] / src / shared / mapdef_impl.inc
3 // ////////////////////////////////////////////////////////////////////////// //
4 // trigger helpers
6 // TRIGGER_EXIT
7 function TDynRecordHelper.trigMap (): AnsiString; inline; begin result := utf2win(getFieldWithType('map', TDynField.TType.TChar).sval); end;
9 // TRIGGER_TELEPORT
10 function TDynRecordHelper.trigTarget (): TDFPoint; inline; begin result := getPointField('target'); end;
11 function TDynRecordHelper.trigD2d (): Boolean; inline; begin result := (getFieldWithType('d2d', TDynField.TType.TBool).ival <> 0); end;
12 function TDynRecordHelper.trigSilent (): Boolean; inline; begin result := (getFieldWithType('silent', TDynField.TType.TBool).ival <> 0); end;
13 function TDynRecordHelper.trigDirection (): Byte; inline; begin result := Byte(getFieldWithType('direction', TDynField.TType.TUByte).ival); end;
15 // TRIGGER_OPENDOOR, TRIGGER_CLOSEDOOR, TRIGGER_DOOR, TRIGGER_DOOR5, TRIGGER_CLOSETRAP, TRIGGER_TRAP, TRIGGER_LIFTUP, TRIGGER_LIFTDOWN, TRIGGER_LIFT
17 // TRIGGER_PRESS, TRIGGER_ON, TRIGGER_OFF, TRIGGER_ONOFF
18 function TDynRecordHelper.trigTX (): LongInt; inline; begin result := LongInt(getFieldWithType('position', TDynField.TType.TPoint).ival); end;
19 function TDynRecordHelper.trigTY (): LongInt; inline; begin result := LongInt(getFieldWithType('position', TDynField.TType.TPoint).ival2); end;
20 function TDynRecordHelper.trigTWidth (): Word; inline; begin result := Word(getFieldWithType('size', TDynField.TType.TSize).ival); end;
21 function TDynRecordHelper.trigTHeight (): Word; inline; begin result := Word(getFieldWithType('size', TDynField.TType.TSize).ival2); end;
22 function TDynRecordHelper.trigWait (): Word; inline; begin result := Word(getFieldWithType('wait', TDynField.TType.TUShort).ival); end;
23 function TDynRecordHelper.trigPressCount (): Word; inline; begin result := Word(getFieldWithType('count', TDynField.TType.TUShort).ival); end;
24 function TDynRecordHelper.trigExtRandom (): Boolean; inline; begin result := (getFieldWithType('ext_random', TDynField.TType.TBool).ival <> 0); end;
25 function TDynRecordHelper.trigSound (): AnsiString; inline; begin result := utf2win(getFieldWithType('sound', TDynField.TType.TString).sval); end;
27 // TRIGGER_SECRET
29 // TRIGGER_TEXTURE
30 function TDynRecordHelper.trigActivateOnce (): Boolean; inline; begin result := (getFieldWithType('activate_once', TDynField.TType.TBool).ival <> 0); end;
31 function TDynRecordHelper.trigAnimateOnce (): Boolean; inline; begin result := (getFieldWithType('animate_once', TDynField.TType.TBool).ival <> 0); end;
33 // TRIGGER_SOUND
34 function TDynRecordHelper.trigSoundName (): AnsiString; inline; begin result := utf2win(getFieldWithType('sound_name', TDynField.TType.TChar).sval); end;
35 function TDynRecordHelper.trigVolume (): Byte; inline; begin result := Byte(getFieldWithType('volume', TDynField.TType.TUByte).ival); end;
36 function TDynRecordHelper.trigPan (): Byte; inline; begin result := Byte(getFieldWithType('pan', TDynField.TType.TUByte).ival); end;
37 function TDynRecordHelper.trigLocal (): Boolean; inline; begin result := (getFieldWithType('local', TDynField.TType.TBool).ival <> 0); end;
38 function TDynRecordHelper.trigPlayCount (): Byte; inline; begin result := Byte(getFieldWithType('play_count', TDynField.TType.TUByte).ival); end;
39 function TDynRecordHelper.trigSoundSwitch (): Boolean; inline; begin result := (getFieldWithType('sound_switch', TDynField.TType.TBool).ival <> 0); end;
41 // TRIGGER_SPAWNMONSTER
42 function TDynRecordHelper.trigSpawnMonsType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end;
43 function TDynRecordHelper.trigHealth (): LongInt; inline; begin result := LongInt(getFieldWithType('health', TDynField.TType.TInt).ival); end;
44 function TDynRecordHelper.trigActive (): Boolean; inline; begin result := (getFieldWithType('active', TDynField.TType.TBool).ival <> 0); end;
45 function TDynRecordHelper.trigMonsCount (): LongInt; inline; begin result := LongInt(getFieldWithType('count', TDynField.TType.TInt).ival); end;
46 function TDynRecordHelper.trigEffect (): Byte; inline; begin result := Byte(getFieldWithType('effect', TDynField.TType.TUByte).ival); end;
47 function TDynRecordHelper.trigMax (): Word; inline; begin result := Word(getFieldWithType('max', TDynField.TType.TUShort).ival); end;
48 function TDynRecordHelper.trigDelay (): Word; inline; begin result := Word(getFieldWithType('delay', TDynField.TType.TUShort).ival); end;
49 function TDynRecordHelper.trigBehaviour (): Byte; inline; begin result := Byte(getFieldWithType('behaviour', TDynField.TType.TUByte).ival); end;
51 // TRIGGER_SPAWNITEM
52 function TDynRecordHelper.trigSpawnItemType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end;
53 function TDynRecordHelper.trigGravity (): Boolean; inline; begin result := (getFieldWithType('gravity', TDynField.TType.TBool).ival <> 0); end;
54 function TDynRecordHelper.trigDmonly (): Boolean; inline; begin result := (getFieldWithType('dmonly', TDynField.TType.TBool).ival <> 0); end;
55 function TDynRecordHelper.trigItemCount (): LongInt; inline; begin result := LongInt(getFieldWithType('count', TDynField.TType.TInt).ival); end;
57 // TRIGGER_MUSIC
58 function TDynRecordHelper.trigMusicName (): AnsiString; inline; begin result := utf2win(getFieldWithType('name', TDynField.TType.TChar).sval); end;
59 function TDynRecordHelper.trigMusicAction (): Byte; inline; begin result := Byte(getFieldWithType('action', TDynField.TType.TUByte).ival); end;
61 // TRIGGER_PUSH
62 function TDynRecordHelper.trigAngle (): Word; inline; begin result := Word(getFieldWithType('angle', TDynField.TType.TUShort).ival); end;
63 function TDynRecordHelper.trigForce (): Byte; inline; begin result := Byte(getFieldWithType('force', TDynField.TType.TUByte).ival); end;
64 function TDynRecordHelper.trigResetVelocity (): Boolean; inline; begin result := (getFieldWithType('reset_velocity', TDynField.TType.TBool).ival <> 0); end;
66 // TRIGGER_SCORE
67 function TDynRecordHelper.trigScoreAction (): Byte; inline; begin result := Byte(getFieldWithType('action', TDynField.TType.TUByte).ival); end;
68 function TDynRecordHelper.trigScoreCount (): Byte; inline; begin result := Byte(getFieldWithType('count', TDynField.TType.TUByte).ival); end;
69 function TDynRecordHelper.trigScoreTeam (): Byte; inline; begin result := Byte(getFieldWithType('team', TDynField.TType.TUByte).ival); end;
70 function TDynRecordHelper.trigScoreCon (): Boolean; inline; begin result := (getFieldWithType('console', TDynField.TType.TBool).ival <> 0); end;
71 function TDynRecordHelper.trigScoreMsg (): Boolean; inline; begin result := (getFieldWithType('message', TDynField.TType.TBool).ival <> 0); end;
73 // TRIGGER_MESSAGE
74 function TDynRecordHelper.trigKind (): Byte; inline; begin result := Byte(getFieldWithType('kind', TDynField.TType.TUByte).ival); end;
75 function TDynRecordHelper.trigMsgDest (): Byte; inline; begin result := Byte(getFieldWithType('dest', TDynField.TType.TUByte).ival); end;
76 function TDynRecordHelper.trigText (): AnsiString; inline; begin result := utf2win(getFieldWithType('text', TDynField.TType.TChar).sval); end;
77 function TDynRecordHelper.trigMsgTime (): Word; inline; begin result := Word(getFieldWithType('time', TDynField.TType.TUShort).ival); end;
79 // TRIGGER_DAMAGE
80 function TDynRecordHelper.trigAmount (): Word; inline; begin result := Word(getFieldWithType('amount', TDynField.TType.TUShort).ival); end;
81 function TDynRecordHelper.trigInterval (): Word; inline; begin result := Word(getFieldWithType('interval', TDynField.TType.TUShort).ival); end;
83 // TRIGGER_HEALTH
84 function TDynRecordHelper.trigHealMax (): Boolean; inline; begin result := (getFieldWithType('max', TDynField.TType.TBool).ival <> 0); end;
86 // TRIGGER_SHOT
87 function TDynRecordHelper.trigShotType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end;
88 function TDynRecordHelper.trigShotTarget (): Byte; inline; begin result := Byte(getFieldWithType('target', TDynField.TType.TUByte).ival); end;
89 function TDynRecordHelper.trigShotSound (): Boolean; inline; begin result := (getFieldWithType('sound', TDynField.TType.TBool).ival = 0); end;
90 function TDynRecordHelper.trigAim (): SmallInt; inline; begin result := ShortInt(getFieldWithType('aim', TDynField.TType.TByte).ival); end;
91 function TDynRecordHelper.trigSight (): Word; inline; begin result := Word(getFieldWithType('sight', TDynField.TType.TUShort).ival); end;
92 function TDynRecordHelper.trigAccuracy (): Word; inline; begin result := Word(getFieldWithType('accuracy', TDynField.TType.TUShort).ival); end;
93 function TDynRecordHelper.trigAmmo (): Word; inline; begin result := Word(getFieldWithType('ammo', TDynField.TType.TUShort).ival); end;
94 function TDynRecordHelper.trigReload (): Word; inline; begin result := Word(getFieldWithType('reload', TDynField.TType.TUShort).ival); end;
96 // TRIGGER_EFFECT
97 function TDynRecordHelper.trigFXCount (): Byte; inline; begin result := Byte(getFieldWithType('count', TDynField.TType.TUByte).ival); end;
98 function TDynRecordHelper.trigFXType (): Byte; inline; begin result := Byte(getFieldWithType('type', TDynField.TType.TUByte).ival); end;
99 function TDynRecordHelper.trigFXSubType (): Byte; inline; begin result := Byte(getFieldWithType('subtype', TDynField.TType.TUByte).ival); end;
100 function TDynRecordHelper.trigFXRed (): Byte; inline; begin result := Byte(getFieldWithType('red', TDynField.TType.TUByte).ival); end;
101 function TDynRecordHelper.trigFXGreen (): Byte; inline; begin result := Byte(getFieldWithType('green', TDynField.TType.TUByte).ival); end;
102 function TDynRecordHelper.trigFXBlue (): Byte; inline; begin result := Byte(getFieldWithType('blue', TDynField.TType.TUByte).ival); end;
103 function TDynRecordHelper.trigFXPos (): Byte; inline; begin result := Byte(getFieldWithType('pos', TDynField.TType.TUByte).ival); end;
104 function TDynRecordHelper.trigVelX (): SmallInt; inline; begin result := ShortInt(getFieldWithType('vel_x', TDynField.TType.TByte).ival); end;
105 function TDynRecordHelper.trigVelY (): SmallInt; inline; begin result := ShortInt(getFieldWithType('vel_y', TDynField.TType.TByte).ival); end;
106 function TDynRecordHelper.trigSpreadL (): Byte; inline; begin result := Byte(getFieldWithType('spread_l', TDynField.TType.TUByte).ival); end;
107 function TDynRecordHelper.trigSpreadR (): Byte; inline; begin result := Byte(getFieldWithType('spread_r', TDynField.TType.TUByte).ival); end;
108 function TDynRecordHelper.trigSpreadU (): Byte; inline; begin result := Byte(getFieldWithType('spread_u', TDynField.TType.TUByte).ival); end;
109 function TDynRecordHelper.trigSpreadD (): Byte; inline; begin result := Byte(getFieldWithType('spread_d', TDynField.TType.TUByte).ival); end;