~ubuntu-branches/ubuntu/saucy/egoboo-data/saucy

« back to all changes in this revision

Viewing changes to modules/catacomb2.mod/objects/ghost.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
//Tactics: Wait until enemy show up, when he does, always follow it until it is
 
2
//defeated
 
3
 
 
4
//Randomize ghost skin
 
5
IfSpawned
 
6
  tmpargument = rand % 4
 
7
  ChangeArmor
 
8
 
 
9
//This makes ghosts fly up and down
 
10
tmpx = targetz
 
11
tmpy = selfz
 
12
IfXIsMoreThanY
 
13
  IfTargetIsOnHatedTeam
 
14
    tmpargument = rand & 30 - 15 + targetz
 
15
    SetFlyHeight
 
16
Else
 
17
  tmpargument = 38
 
18
  SetFlyHeight          //Reset to normal
 
19
 
 
20
//------------------------------------------------------------------------------
 
21
//New round
 
22
IfTimeOut
 
23
  tmpargument = rand & 20 +  32
 
24
  SetTime                               //Redo timer
 
25
 
 
26
  tmpx = rand & 100                     //Moaning sound?
 
27
  tmpy = rand & 1
 
28
  IfXIsLessThanY
 
29
    tmpargument = 3
 
30
    IfContentIs                 //Dont if timer is short becuase
 
31
      tmpargument = rand % 5 + 3                //of attacking
 
32
      tmpdistance = rand & 4000 + 6000
 
33
      PlaySound
 
34
    Else
 
35
      GetContent                        
 
36
      tmpx = tmpargument
 
37
      tmpy = 3
 
38
      IfXIsLessThanY
 
39
        tmpargument = 3
 
40
        SetContent
 
41
 
 
42
 
 
43
  //Dorment
 
44
  IfStateIs0                    
 
45
    SetTargetToWideEnemy
 
46
      tmpx = targetx
 
47
      tmpy = targety
 
48
      tmpargument = 1
 
49
      IfTargetIsAlive
 
50
        SetState
 
51
        tmpx = selfspawnx
 
52
        tmpy = selfspawny
 
53
    Else
 
54
      tmpx = selfspawnx
 
55
      tmpy = selfspawny
 
56
    ClearWaypoints
 
57
    AddWaypoint
 
58
 
 
59
  //Hunting
 
60
  IfStateIs1
 
61
    tmpx = targetx
 
62
    tmpy = targety                      //Move towards enemy
 
63
    ClearWaypoints
 
64
    AddWaypoint
 
65
    tmpx = rand & 100                   //Sometimes charge instead
 
66
    tmpy = 10                           //10%
 
67
    IfXIsLessThanY
 
68
      tmpargument = 100                         //charges are fast
 
69
      SetSpeedPercent
 
70
      tmpx = targetx
 
71
      tmpy = targety
 
72
      tmpturn = targetturnto
 
73
      tmpdistance = 700
 
74
      ClearWaypoints
 
75
      AddWaypoint
 
76
 
 
77
    //Dont flock
 
78
    SetOldTarget                        //Remember enemy
 
79
    SetTargetToNearestFriend
 
80
    tmpx = targetdistance
 
81
    tmpy = 90
 
82
    IfXIsLessThanY                      //To close to friend?
 
83
      tmpx = rand & 500 + targetx - 250
 
84
      tmpy = rand & 500 + targety - 250
 
85
      SetTargetToOldTarget              //Enemy
 
86
      tmpturn = targetturnto
 
87
      tmpdistance = rand & 1000
 
88
      Compass
 
89
      ClearWaypoints
 
90
      AddWaypoint                       //Move randomly away from him
 
91
      tmpargument = rand & 30 + 30
 
92
      SetTime
 
93
    Else
 
94
      SetTargetToOldTarget              //Set target back to enemy
 
95
 
 
96
//Attack enemy
 
97
IfStateIs1
 
98
  IfTargetIsOnHatedTeam
 
99
    tmpx = targetdistance               //Close enough?
 
100
    tmpy = 150
 
101
    IfXIsLessThanY
 
102
      tmpargument = rand % 2            //Randomize attack left or right hand
 
103
      SetContent
 
104
      tmpargument = 1
 
105
      IfContentIs                       //Attack right
 
106
        tmpargument = LATCHRIGHT
 
107
      Else                              //Attack left
 
108
        tmpargument = LATCHLEFT
 
109
      IfTargetIsAlive
 
110
        PressLatchButton
 
111
      tmpargument = 0
 
112
      SetTime
 
113
 
 
114
 
 
115
//------------------------------------------------------------------------------
 
116
//Hit by silver
 
117
IfHitVulnerable
 
118
  tmpargument = rand & 1280 + 1024      //4-9 damage
 
119
  tmpdistance = DAMAGEHOLY
 
120
  SetTargetToSelf
 
121
  DamageTarget
 
122
  tmpargument = 9
 
123
  tmpdistance = rand & 8000 + 11000
 
124
  PlaySound                     //Special feared sound
 
125
  tmpargument = 3
 
126
  SendMessageNear
 
127
 
 
128
//------------------------------------------------------------------------------
 
129
//Return to dorment state when enemy is defeated
 
130
IfTargetIsAlive
 
131
  DoNothing
 
132
Else
 
133
  tmpargument = 0
 
134
  SetState
 
135
 
 
136
//------------------------------------------------------------------------------
 
137
//Holy damage makes ghosts scared
 
138
IfAttacked
 
139
  GetDamageType
 
140
  tmpy = tmpargument
 
141
  tmpx = DAMAGEHOLY
 
142
  IfXIsEqualToY
 
143
    tmpx = targetx
 
144
    tmpy = targety
 
145
    tmpturn = targetturnto + 36780              //TargetTurnAway
 
146
    tmpdistance = 12000
 
147
    Compass
 
148
    ClearWaypoints
 
149
    AddWaypoint
 
150
    tmpargument = rand & 80 + 50
 
151
    SetTime
 
152
    tmpargument = 9
 
153
    tmpdistance = rand & 8000 + 11000
 
154
    PlaySound                   //Special feared sound
 
155
    tmpargument = 3
 
156
    SendMessageNear
 
157
  Else                                          //Normal ouch
 
158
    tmpargument = rand & 1
 
159
    tmpdistance = rand & 8000 + 11000
 
160
    PlaySound                   //Ouch sound
 
161
 
 
162
//------------------------------------------------------------------------------
 
163
//Death stuff
 
164
IfKilled
 
165
  tmpargument = 2
 
166
  tmpdistance = rand & 8000 + 11000
 
167
  PlaySound                     //death sound
 
168
  tmpargument = 0
 
169
  IfTargetIsOnSameTeam
 
170
    tmpargument = 1
 
171
  SendMessageNear
 
172
  tmpargument = 4
 
173
  SpawnPoof
 
174
  tmpargument = 2
 
175
  tmpx = selfx
 
176
  tmpy = selfy
 
177
  tmpdistance = selfz
 
178
  SpawnExactParticle
 
179
  GoPoof
 
180
 
 
181
//------------------------------------------------------------------------------
 
182
End
 
183
//------------------------------------------------------------------------------