~ubuntu-branches/ubuntu/precise/egoboo-data/precise

« back to all changes in this revision

Viewing changes to modules/heist.mod/objects/rougeknife.obj/script.txt

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2010-04-25 10:20:11 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100425102011-1aosouybjkexdg9v
Tags: 1:2.7.7-1
* New Upstream Release
* Switch to debhelper

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
IfSpawned
 
2
  tmpargument = 2
 
3
  ClosePassage
 
4
//------------------------------------------------------------------------------
 
5
// ZZ> Jump over corpses
 
6
IfBumped
 
7
  SetTargetToWhoeverBumped
 
8
  IfTargetIsAlive
 
9
    tmpargument = [CHES]
 
10
    IfTargetHasID
 
11
      tmpargument = LATCHJUMP
 
12
      PressLatchButton
 
13
  Else
 
14
    tmpargument = LATCHJUMP
 
15
    PressLatchButton
 
16
  SetTargetToOldTarget
 
17
 
 
18
 
 
19
//------------------------------------------------------------------------------
 
20
//Wait for a rouge to bump
 
21
IfStateIs0
 
22
  IfBumped
 
23
    SetTargetToWhoeverBumped
 
24
    tmpargument = [ROGU]                //Only rogues
 
25
    IfTargetHasID
 
26
      AddStat
 
27
      tmpargument = 1
 
28
      SetState
 
29
      tmpargument = 3
 
30
      SendMessageNear
 
31
      tmpargument = 6
 
32
      PlaySound                         //Ill watch ya back!
 
33
      tmpargument = 2
 
34
      OpenPassage                               //Open start door
 
35
    Else
 
36
      tmpargument = 5
 
37
      SendMessageNear
 
38
      tmpargument = 2
 
39
      SetState
 
40
      tmpargument = 50
 
41
      SetTime
 
42
IfStateIs3
 
43
  IfBumped
 
44
    SetTargetToWhoeverBumped
 
45
    IfTargetIsOnSameTeam
 
46
      tmpargument = 6
 
47
      SendMessageNear
 
48
      tmpargument = 4
 
49
      SetState
 
50
      tmpargument = 50
 
51
      SetTime
 
52
 
 
53
 
 
54
//------------------------------------------------------------------------------
 
55
//Update check
 
56
IfTimeOut
 
57
 
 
58
  IfStateIs2                    //Wait before talking
 
59
    tmpargument = 0
 
60
    SetState
 
61
 
 
62
  IfStateIs4                    //Wait before talking
 
63
    tmpargument = 3
 
64
    SetState
 
65
 
 
66
  IfStateIs0
 
67
    SetTargetToNearestFriend
 
68
      // Approach the player
 
69
      tmpx = targetx
 
70
      tmpy = targety
 
71
      tmpturn = targetturnto
 
72
      tmpdistance = 0
 
73
      Compass
 
74
      ClearWaypoints
 
75
      AddWaypoint
 
76
      tmpargument = 20
 
77
      SetTime
 
78
    Else
 
79
      // Walk around in a circle
 
80
      tmpx = selfx
 
81
      tmpy = selfy
 
82
      tmpturn = selfturn + 8192
 
83
      tmpdistance = 200
 
84
      Compass
 
85
      ClearWaypoints
 
86
      AddWaypoint
 
87
      tmpargument = 20
 
88
      SetTime
 
89
 
 
90
  //Follow and combat
 
91
  IfStateIs1
 
92
 
 
93
    //Draw weapons
 
94
    tmpargument = 2
 
95
    IfContentIs
 
96
      DoNothing
 
97
    Else
 
98
      SetTargetToSelf
 
99
      SetTargetToTargetLeftHand
 
100
        SetTargetToSelf
 
101
        SetTargetToTargetRightHand
 
102
          DoNothing
 
103
        Else
 
104
          tmpargument = LATCHPACKRIGHT
 
105
          PressLatchButton
 
106
      Else
 
107
        tmpargument = LATCHPACKLEFT
 
108
        PressLatchButton
 
109
        GetContent
 
110
        tmpargument = tmpargument +1
 
111
        SetContent
 
112
 
 
113
    // Get in a fight
 
114
    tmpdistance = 250000
 
115
    SetTargetToDistantEnemy
 
116
      // Charge!
 
117
      tmpx = targetx
 
118
      tmpy = targety
 
119
      tmpdistance = 300
 
120
      tmpturn = targetturnto
 
121
      Compass
 
122
      ClearWaypoints
 
123
      AddWaypoint
 
124
      // Take a stab?
 
125
      tmpx = targetdistance
 
126
      tmpy = 120
 
127
      IfXIsLessThanY
 
128
        IfFacingTarget
 
129
          tmpargument = rand & 1 + 1
 
130
          PressLatchButton
 
131
      tmpargument = 10
 
132
      SetTime
 
133
 
 
134
    Else
 
135
      // Follow the Player around
 
136
      SetTargetToLeader
 
137
      tmpx = targetdistance
 
138
      tmpy = 200
 
139
      IfXIsLessThanY
 
140
        tmpx = targetx
 
141
        tmpy = targety
 
142
        tmpturn = targetturnto + 32768
 
143
        tmpdistance = 100
 
144
        Compass
 
145
        ClearWaypoints
 
146
        AddWaypoint
 
147
        tmpargument = 20
 
148
        SetTime
 
149
      Else
 
150
        // Run after the player
 
151
        tmpx = targetx
 
152
        tmpy = targety
 
153
        tmpturn = targetturnto
 
154
        tmpdistance = 400
 
155
        Compass
 
156
        ClearWaypoints
 
157
        AddWaypoint
 
158
        tmpargument = 20
 
159
        SetTime
 
160
 
 
161
      //Handle jumping
 
162
      tmpx = targetaltitude
 
163
      tmpy = selfz + 25
 
164
      IfXIsMoreThanY
 
165
        tmpargument = LATCHJUMP
 
166
        PressLatchButton
 
167
 
 
168
 
 
169
      //K'nife is in the assigned passage
 
170
      tmpargument = passage
 
171
      tmpdistance = [THIE]
 
172
      SetTargetToPassageID
 
173
        tmpdistance = [KEYA]
 
174
        SetTargetToPassageID
 
175
          tmpargument = 3
 
176
          SetState                      //Stand on button
 
177
          tmpargument = 6
 
178
          SendMessageNear               //I'll wait here!
 
179
          tmpargument = 5
 
180
          PlaySound
 
181
        Else
 
182
          tmpargument = 4
 
183
          SendMessageNear               //We need a key!
 
184
          tmpargument = 5
 
185
          PlaySound
 
186
          tmpargument = 100
 
187
          SetTime
 
188
 
 
189
 
 
190
  //Stand on button state
 
191
  IfStateIs3
 
192
    SetTurnModeToVelocity
 
193
    tmpargument = 20
 
194
    SetTime
 
195
    SetTargetToWideEnemy
 
196
      tmpargument = 1
 
197
      SetState          //Return to follow
 
198
    Else
 
199
      tmpx = 3522
 
200
      tmpy = 3651       //Coordinates for the button
 
201
      ClearWaypoints
 
202
      AddWaypoint
 
203
      tmpx = gotodistance
 
204
      tmpy = 60
 
205
      IfXIsMoreThanY
 
206
        tmpx = gotodistance             //Close enough to jump?
 
207
        tmpy = 150
 
208
        IfXIsLessThanY
 
209
          tmpargument = LATCHJUMP       //Jump on the button
 
210
          PressLatchButton
 
211
      Else
 
212
        SetTargetToLeader               //Turn to the player when standing on the button
 
213
        SetTurnModeToWatchTarget
 
214
 
 
215
//------------------------------------------------------------------------------
 
216
// ZZ> Handle death by sending a message and other stuff
 
217
IfKilled
 
218
  tmpargument = 2
 
219
  tmpdistance = rand & 1027 + 11000
 
220
  PlaySound
 
221
  tmpargument = 0
 
222
  IfTargetIsOnSameTeam
 
223
    tmpargument = 1
 
224
  SendMessage
 
225
 
 
226
  // Drop goodies
 
227
  tmpargument = 65535
 
228
  DropMoney
 
229
  DropItems
 
230
  DropKeys
 
231
 
 
232
  // Make the character body
 
233
  tmpargument = 45
 
234
  SetBumpHeight
 
235
 
 
236
 
 
237
//------------------------------------------------------------------------------
 
238
// ZZ> Handle being attacked by blocking or countering or running away
 
239
IfAttacked
 
240
  SetTargetToWhoeverAttacked
 
241
  IfTargetIsOnSameTeam
 
242
    tmpargument = 5
 
243
    tmpdistance = rand & 1027 + 11000
 
244
    PlaySound
 
245
    tmpargument = 2
 
246
    SendMessageNear
 
247
 
 
248
    //Get unfriendly
 
249
    IfStateIs0
 
250
      JoinEvilTeam
 
251
      tmpargument = 1
 
252
      SetState
 
253
    
 
254
  Else
 
255
    tmpargument = rand & 1 + 3
 
256
    tmpdistance = rand & 1027 + 11000
 
257
    PlaySound
 
258
  SetTargetToOldTarget
 
259
 
 
260
//------------------------------------------------------------------------------
 
261
End
 
262
//------------------------------------------------------------------------------