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

« back to all changes in this revision

Viewing changes to modules/paladin.mod/objects/ulna.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
//AI note:s Set Content to 1 if you want a Ulna thrower. Leader Ulna are 
 
2
//automatically transformed when level is 2 or higher (This is only checked on spawn).
 
3
//Dexterity increases attack speed
 
4
//Ranged attacks are always made from left hand
 
5
//------------------------------------------------------------------------------
 
6
// Check for a kill order
 
7
IfOrdered
 
8
  tmpx = selforder
 
9
  tmpy = [UNDO]
 
10
  IfXIsEqualToY
 
11
    UndoEnchant
 
12
 
 
13
 
 
14
//------------------------------------------------------------------------------
 
15
// Setup character
 
16
IfSpawned
 
17
  SetTargetToSelf
 
18
  tmpx = targetlevel
 
19
  tmpy = 0
 
20
  IfXIsMoreThanY        //Ulna is a leader?
 
21
    tmpargument = 1
 
22
    ChangeArmor
 
23
    BecomeLeader
 
24
  EnchantTarget         // target is self...
 
25
  Walk
 
26
  GetContent    //Set ranged or melee AI
 
27
  SetState              //0 is melee and 1 is ranged (Leaders automatically use both)
 
28
  MakeCrushValid        //Ulnas can be crushed
 
29
 
 
30
 
 
31
//Make the bones flying
 
32
IfCrushed
 
33
  tmpx = selfx
 
34
  tmpy = selfy
 
35
  tmpdistance = selfz
 
36
  tmpargument = 1
 
37
  SpawnExactParticle
 
38
  SpawnExactParticle
 
39
  SpawnExactParticle
 
40
  SpawnExactParticle
 
41
  GoPoof
 
42
  tmpargument = 1
 
43
  SendMessageNear
 
44
 
 
45
 
 
46
//------------------------------------------------------------------------------
 
47
//Handle death by sending a message and other stuff
 
48
IfKilled
 
49
  tmpargument = 1               //Ulna Captain
 
50
  IfArmorIs
 
51
    DoNothing
 
52
  Else
 
53
    tmpargument = 0             //Normal Ulna
 
54
    IfContentIs
 
55
      DoNothing
 
56
    Else
 
57
      tmpargument = 2           //Bone thrower
 
58
  IfTargetIsOnSameTeam
 
59
    tmpargument = 3             //Teamkill
 
60
  SendMessageNear
 
61
 
 
62
  // Drop goodies
 
63
  tmpargument = 65535
 
64
  DropMoney
 
65
 
 
66
  // Make the character body
 
67
  tmpargument = 45
 
68
  SetBumpHeight
 
69
 
 
70
 
 
71
//------------------------------------------------------------------------------
 
72
// For helper AIs
 
73
IfLeaderKilled
 
74
  BecomeLeader
 
75
 
 
76
 
 
77
//------------------------------------------------------------------------------
 
78
//New round
 
79
IfTimeOut
 
80
  Walk
 
81
  SetTargetToWideEnemy          //Find enemy
 
82
 
 
83
    //MELEE AI
 
84
    IfStateIs0
 
85
      tmpx = targetdistance
 
86
      tmpy = 220
 
87
      IfXIsLessThanY
 
88
        IfFacingTarget
 
89
          tmpargument = 1               //Leader Ulna always react fast
 
90
          IfArmorIs
 
91
            tmpargument = LATCHRIGHT
 
92
            PressLatchButton
 
93
          Else
 
94
            tmpx = rand & 25600
 
95
            tmpy = 3940+ selfdex                //15% chance to attack +1% per dex
 
96
            IfXIsLessThanY              //See if he reacts fast enough to attack
 
97
              tmpargument = LATCHRIGHT
 
98
              PressLatchButton
 
99
        tmpx = targetx
 
100
        tmpy = targety
 
101
        tmpdistance = 200
 
102
        tmpturn = targetturnto
 
103
        Compass
 
104
      Else                      //Randomize attack approach
 
105
        Run                     //Move fast
 
106
        tmpx = rand & 256 + targetx - 128
 
107
        tmpy = rand & 256 + targety - 128
 
108
        tmpargument = 1         //Leader Ulna throws a bone
 
109
        IfArmorIs
 
110
          IfFacingTarget                //Make sure to aim
 
111
            SetTargetToSelf
 
112
            SetTargetToTargetLeftHand   //Check for left hand items
 
113
              DoNothing                 //Left hand free for use
 
114
            Else
 
115
              tmpargument = LATCHLEFT   //Assuming having no weapon in
 
116
              PressLatchButton          //left hand
 
117
            SetTargetToOldTarget
 
118
      tmpargument = 20
 
119
      SetTime
 
120
 
 
121
    //RANGED COMBAT AI
 
122
    IfStateIs1
 
123
      tmpx = targetdistance
 
124
      tmpy = 150
 
125
      IfXIsMoreThanY            //Far enough away?
 
126
        IfFacingTarget          //Aim
 
127
          tmpx = rand & 25600
 
128
          tmpy = selfdex                //1% per dex
 
129
          IfXIsLessThanY                //See if he reacts fast enough to throw
 
130
            tmpargument = LATCHLEFT
 
131
            PressLatchButton
 
132
        tmpx = targetx          //Keep moving towards enemy
 
133
        tmpy = targety
 
134
        tmpturn = targetturnto
 
135
        tmpdistance = 0
 
136
        Compass
 
137
      Else                      //Too close, run away
 
138
        Run
 
139
        tmpx = rand & 256 + targetx - 128
 
140
        tmpy = rand & 256 + targety - 128
 
141
        tmpturn = targetturnto
 
142
        tmpdistance = 400
 
143
        Compass
 
144
        tmpargument = rand & 15 + 5
 
145
        SetTime
 
146
 
 
147
  Else                          //No enemy found, wander instead
 
148
    tmpargument = rand & 31 + 120
 
149
    SetTime
 
150
    tmpx = rand & 1023 - 512 + selfspawnx
 
151
    tmpy = rand & 1023 - 512 + selfspawny
 
152
  ClearWaypoints
 
153
  AddWaypoint
 
154
IfAtLastWaypoint                //Don't stand still
 
155
  tmpargument = 0
 
156
  SetTime
 
157
 
 
158
//Dont spam attack
 
159
IfUsed
 
160
  IfStateIs1
 
161
    tmpargument = 80
 
162
    SetReloadTime
 
163
 
 
164
//------------------------------------------------------------------------------
 
165
//Handle being attacked by blocking or countering or running away
 
166
IfAttacked
 
167
 
 
168
  // Chase the attacker
 
169
  SetTargetToWhoeverAttacked
 
170
  IfTargetIsOnHatedTeam
 
171
    tmpx = targetx
 
172
    tmpy = targety
 
173
    tmpdistance = 200
 
174
    tmpturn = targetturnto
 
175
    Compass
 
176
    ClearWaypoints
 
177
    AddWaypoint
 
178
    tmpargument = 30
 
179
    SetTime
 
180
 
 
181
 
 
182
//------------------------------------------------------------------------------
 
183
//Instantly counterattack
 
184
IfBumped
 
185
  SetTargetToWhoeverBumped
 
186
  IfTargetIsOnHatedTeam
 
187
    IfFacingTarget
 
188
      tmpargument = LATCHRIGHT
 
189
      PressLatchButton
 
190
    Else
 
191
      tmpx = targetx
 
192
      tmpy = targety
 
193
      tmpdistance = 200
 
194
      tmpturn = targetturnto
 
195
      Compass
 
196
      ClearWaypoints
 
197
      AddWaypoint
 
198
      tmpargument = 30
 
199
      SetTime
 
200
  Else                  //Not an enemy
 
201
    tmpargument = 0
 
202
    SetTime
 
203
    SetTargetToOldTarget
 
204
 
 
205
 
 
206
//------------------------------------------------------------------------------
 
207
End
 
208
//------------------------------------------------------------------------------