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

« back to all changes in this revision

Viewing changes to modules/catacomb2.mod/objects/vampire.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
//The different states:
 
2
//0: Wandering around looking for enemies (And following the leader)
 
3
//1: In combat
 
4
//2: Feared
 
5
//3: Gass form
 
6
 
 
7
//------------------------------------------------------------------------------
 
8
//How fast can he attack?
 
9
IfUsed
 
10
  tmpargument = rand & 50 + 25
 
11
  SetReloadTime
 
12
 
 
13
//------------------------------------------------------------------------------
 
14
//Always have 1 vampire leader
 
15
IfSpawned
 
16
  BecomeLeader
 
17
IfLeaderKilled
 
18
  BecomeLeader
 
19
 
 
20
//------------------------------------------------------------------------------
 
21
//Gass cloud effect
 
22
tmpargument = 1
 
23
IfArmorIs
 
24
  GetContent
 
25
  tmpx = tmpargument
 
26
  tmpy = 7
 
27
  IfXIsMoreThanY
 
28
    tmpargument = 5
 
29
    tmpx = selfx
 
30
    tmpy = selfy
 
31
    tmpdistance = rand & 100 + selfz
 
32
    SpawnExactParticle
 
33
    tmpargument = 0
 
34
    SetContent
 
35
  Else
 
36
    GetContent
 
37
    tmpargument = tmpargument + 1
 
38
    SetContent
 
39
 
 
40
//------------------------------------------------------------------------------
 
41
// Let the character walk around
 
42
IfTimeOut
 
43
 
 
44
  //Turn to gass to escape?
 
45
  tmpx = selflife
 
46
  tmpy = 2700
 
47
  IfXIsLessThanY        //Turn to gass if less than 11 life left
 
48
    tmpargument = 3
 
49
    IfStateIsNot        //Dont become gass if already gas
 
50
      tmpargument = 1
 
51
      ChangeArmor
 
52
      tmpargument = 3   //Gass mode
 
53
      SetState
 
54
      tmpargument = 4   //Sound effect and message
 
55
      SendMessageNear
 
56
      tmpargument = 5
 
57
      tmpdistance = rand & 2000 + 8000
 
58
      PlaySound
 
59
      SetTargetToRider
 
60
        tmpargument = [HIDE]
 
61
        OrderTarget     //Hide the wings
 
62
 
 
63
  //Wandering around following lead vampire
 
64
  IfStateIs0
 
65
    Walk
 
66
    SetTargetToWideEnemy                //Found a enemy, enter combat mode
 
67
      tmpargument = rand & 20 + 10
 
68
      SetTime
 
69
      tmpargument = 1
 
70
      SetState
 
71
      tmpx = targetx
 
72
      tmpy = targety
 
73
      tmpdistance = 200
 
74
      tmpturn = targetturnto
 
75
      Compass
 
76
      ClearWaypoints
 
77
      AddWaypoint
 
78
    Else                                //No enemies, wander around
 
79
      tmpargument = rand & 61 + 60
 
80
      SetTime
 
81
      tmpx = rand & 1023 - 512 + leaderx
 
82
      tmpy = rand & 1023 - 512 + leadery
 
83
      Compass
 
84
      ClearWaypoints
 
85
      AddWaypoint
 
86
 
 
87
  //Combat mode
 
88
  IfStateIs1
 
89
    Run
 
90
    tmpargument = 20
 
91
    SetTime
 
92
    tmpargument = 1
 
93
    SetState
 
94
    tmpx = targetx
 
95
    tmpy = targety
 
96
    tmpdistance = 200
 
97
    tmpturn = targetturnto
 
98
    Compass
 
99
    ClearWaypoints
 
100
    AddWaypoint    
 
101
    tmpx = targetdistance
 
102
    tmpy = 110
 
103
    IfXIsLessThanY                      //Close enough?
 
104
      IfFacingTarget                    //Are we looking at the enemy?
 
105
        
 
106
        //If the target defends, either wait or find new target
 
107
        IfTargetIsDefending             
 
108
          SetTargetToNearestEnemy
 
109
          IfAttacked
 
110
            SetTargetToWhoeverAttacked
 
111
          tmpx = selfx
 
112
          tmpy = selfy
 
113
          tmpdistance = 250
 
114
          tmpturn = targetturnto
 
115
          Compass
 
116
          ClearWaypoints
 
117
          AddWaypoint        
 
118
   
 
119
        Else                            //Attack the enemy
 
120
          IfTargetIsOnHatedTeam         //Only if he is a enemy
 
121
            tmpargument = LATCHRIGHT
 
122
            PressLatchButton
 
123
 
 
124
  //Feared
 
125
  IfStateIs2
 
126
    Run
 
127
    tmpx = rand & 2023 - 1000 + targetx
 
128
    tmpy = rand & 2023 - 1000 + targety
 
129
    tmpdistance = 600
 
130
    tmpturn = rand
 
131
    Compass
 
132
    ClearWaypoints
 
133
    AddWaypoint   
 
134
    tmpargument = 450
 
135
    SetTime
 
136
    tmpargument = 0
 
137
    SetState
 
138
 
 
139
  //Gass cloud
 
140
  IfStateIs3     
 
141
    tmpargument = 450
 
142
    SetTime
 
143
    tmpx = selflife
 
144
    tmpy = 3000                         //About 12 life should be enough
 
145
    IfXIsMoreThanY                      //Do we have enough life to return to combat?
 
146
      tmpargument = 0                   //If so, become normal again  
 
147
      ChangeArmor                       //Become visible
 
148
      SetState                          //Return to leader or wandering mode
 
149
      SetTime
 
150
      SetTargetToRider
 
151
        tmpargument = [HIDE]
 
152
        OrderTarget     //Show the wings
 
153
      tmpargument = 5                   //Sound effect
 
154
      tmpdistance = rand & 2000 + 8000
 
155
      PlaySound
 
156
    Else                                //Nope, still too hurt, hide and heal
 
157
      Run
 
158
      SetTargetToNearestEnemy
 
159
      tmpx = rand & 2023 - 1000 + targetx
 
160
      tmpy = rand & 2023 - 1000 + targety
 
161
      tmpdistance = 600
 
162
      tmpturn = targetturnto + 360              //Run away
 
163
      Compass
 
164
      ClearWaypoints
 
165
      AddWaypoint  
 
166
      tmpargument = 356 + rand & 456    //Regenerate extra while in gass form
 
167
      HealSelf
 
168
 
 
169
 
 
170
//Don't just stand still
 
171
IfAtLastWaypoint
 
172
  tmpargument = 3       //Don't do this if gass cloud
 
173
  IfStateIsNot
 
174
    tmpargument = 0
 
175
    SetState
 
176
 
 
177
//------------------------------------------------------------------------------
 
178
//What to do if enemy is dead
 
179
IfTargetKilled
 
180
  tmpargument = 3
 
181
  IfStateIsNot                  //Only do if not gass form
 
182
    SetTargetToNearbyEnemy
 
183
      tmpargument = 1           //Engage nearby enemy
 
184
    Else
 
185
      tmpargument = 0           //Return to leader
 
186
    SetState
 
187
 
 
188
 
 
189
//------------------------------------------------------------------------------
 
190
//Handle being attacked by blocking or countering or running away
 
191
IfAttacked
 
192
 
 
193
  //Engage the attacker
 
194
  SetTargetToWhoeverAttacked
 
195
  IfTargetIsOnHatedTeam
 
196
    GetState
 
197
    tmpx = 2                    //Only if idle of in combat mode
 
198
    tmpy = tmpargument
 
199
    IfXIsLessThanY
 
200
      tmpx = targetx            //Else - counter attack
 
201
      tmpy = targety
 
202
      tmpdistance = 200
 
203
      tmpturn = targetturnto
 
204
      Compass
 
205
      ClearWaypoints
 
206
      AddWaypoint
 
207
      tmpargument = 30
 
208
      SetTime
 
209
  Else                          //Whoops, friendly fire
 
210
    SetTargetToNearestEnemy
 
211
  
 
212
  //Cover in fear if damaged by holy
 
213
  GetDamageType
 
214
  tmpx = tmpargument
 
215
  tmpy = DAMAGEHOLY
 
216
  IfXIsEqualToY
 
217
    tmpargument = 1
 
218
    SendMessageNear
 
219
    tmpargument = 3
 
220
    IfStateIsNot        //Dont do this if in gass form
 
221
      tmpargument = 2   //Become Feared
 
222
      SetState
 
223
    tmpargument = 4     //Play feared ouch sound
 
224
  Else
 
225
    tmpargument = rand & 1 + 1  //Play normal ouch sound
 
226
 
 
227
  //Silver weapons are super effective
 
228
  IfHitVulnerable
 
229
    SetTargetToSelf
 
230
    tmpargument = rand & 1500 + 1000
 
231
    tmpdistance = DAMAGEFIRE
 
232
    DamageTarget
 
233
    SetTargetToOldTarget
 
234
    tmpargument = 4    //Play feared ouch sound
 
235
 
 
236
  //In gass form the vampire has weakness to fire and holy damage is instant kill
 
237
  IfStateIs3
 
238
    GetDamageType
 
239
    tmpx = tmpargument
 
240
    tmpy = DAMAGEFIRE
 
241
    IfXIsEqualToY
 
242
      SetTargetToSelf
 
243
      tmpargument = rand & 1500 + 2000
 
244
      tmpdistance = DAMAGEFIRE
 
245
      DamageTarget
 
246
      SetTargetToOldTarget
 
247
      tmpargument = 4     //Play feared ouch sound
 
248
 
 
249
    GetDamageType
 
250
    tmpx = tmpargument
 
251
    tmpy = DAMAGEHOLY
 
252
    IfXIsEqualToY
 
253
      SetTargetToWhoeverAttacked
 
254
      tmpargument = 30
 
255
      tmpdistance = EXPREVENGE  //Give bonus xp
 
256
      GiveExperienceToTarget
 
257
      SetTargetToSelf           //Holy damage is instant kill
 
258
      KillTarget
 
259
      tmpargument = 5
 
260
      SendMessageNear
 
261
 
 
262
  tmpdistance = rand & 10000 + 5000
 
263
  PlaySound
 
264
 
 
265
 
 
266
 
 
267
//------------------------------------------------------------------------------
 
268
//Always attack enemies who bump
 
269
IfBumped
 
270
  SetTargetToWhoeverBumped
 
271
  IfTargetIsOnHatedTeam
 
272
    DoNothing
 
273
  Else
 
274
    SetTargetToOldTarget
 
275
 
 
276
//------------------------------------------------------------------------------
 
277
//Handle death by sending a message and other stuff
 
278
IfKilled
 
279
  tmpargument = 0
 
280
  IfTargetIsOnSameTeam
 
281
    tmpargument = 2
 
282
    IfTargetIsSelf
 
283
      tmpargument = 3
 
284
  SendMessageNear
 
285
 
 
286
  tmpargument = 3       //Play death sound
 
287
  tmpdistance = rand & 10000 + 5000
 
288
  PlaySound
 
289
 
 
290
  //If gass form, become normal
 
291
  tmpargument = 1
 
292
  IfArmorIs
 
293
    tmpargument = 0
 
294
    ChangeArmor
 
295
    SetTargetToRider
 
296
    tmpargument = [HIDE]        //Show the wings
 
297
    OrderTarget
 
298
    
 
299
 
 
300
  // Drop goodies
 
301
  tmpargument = 65535
 
302
  DropMoney
 
303
  DropKeys
 
304
 
 
305
  // Make the character body
 
306
  tmpargument = 45
 
307
  SetBumpHeight
 
308
 
 
309
  // Stop flying
 
310
  tmpargument = 0
 
311
  SetFlyHeight
 
312
 
 
313
  // Tell the wings to stop flappin'
 
314
  SetTargetToRider // The wings are on gripleft, so this works
 
315
  tmpargument = [DEAD]
 
316
  OrderTarget
 
317
 
 
318
 
 
319
//------------------------------------------------------------------------------
 
320
End
 
321
//------------------------------------------------------------------------------