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

« back to all changes in this revision

Viewing changes to modules/bishopiacity.mod/objects/whirlwind.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
// Whirlwind Spell
 
2
//    By Pteromys of Melon Island - http://melonisland.net
 
3
//  Usage:
 
4
//    Hold down ATTACK to charge up a spell. When the smokies
 
5
//     start moving vertically, release it to make a little
 
6
//     twister that sucks enemies in. Press ATTACK again to
 
7
//     kill the twister.  Useful for "congregating" enemies
 
8
//     so you can finish them off with a fireball.
 
9
//  Guide to object states:
 
10
//   0   spellbook or a spell in hand
 
11
//   1   a whirlwind
 
12
//  Offhand peculiarities noticed while scripting:
 
13
//   Crushing will have no effect on an object that has bump
 
14
//   dimensions of zero.
 
15
 
 
16
IfSpawned
 
17
  IfStateIs0                                    // A spellbook
 
18
    KeepAction
 
19
  Else                                          // Or a howling gale?
 
20
    NotAnItem                                   // Don't let anyone pick it up
 
21
    MakeNameUnknown
 
22
    MakeCrushValid
 
23
    tmpargument = 127
 
24
    SetLight
 
25
    SetTurnModeToSpin
 
26
    tmpargument = 50
 
27
    SetTime
 
28
 
 
29
IfChanged                                       // It's a spell in hand
 
30
  tmpargument = 0
 
31
  SetState
 
32
  KeepAction
 
33
 
 
34
// Spell AI...
 
35
IfStateIs0
 
36
  IfTakenOut
 
37
    tmpargument = 0
 
38
    SetContent
 
39
    SetTargetToWhoeverIsHolding
 
40
      IfTargetIsAPlayer
 
41
        tmpargument = 0
 
42
        SendMessageNear
 
43
 
 
44
  IfUsed
 
45
    UnsparkleIcon
 
46
    UndoEnchant                                 // Kill the previous one
 
47
      tmpargument = 50
 
48
      SetReloadTime
 
49
    Else
 
50
      SetTargetToWhoeverIsHolding
 
51
      SetOwnerToTarget
 
52
      tmpx = targetmanaflow
 
53
      tmpy = 1536
 
54
      IfXIsMoreThanY
 
55
        tmpargument = 1536
 
56
        IfContentIs                             // Fully charged?
 
57
          tmpx = targetx
 
58
          tmpy = targety
 
59
          tmpdistance = targetz
 
60
          tmpargument = 2
 
61
          SpawnExactParticle
 
62
        Else                                    // Keep pumping
 
63
          tmpargument = 12
 
64
          CostTargetMana
 
65
            GetContent
 
66
            tmpargument = tmpargument + 12
 
67
            SetContent
 
68
 
 
69
            tmpx = targetx
 
70
            tmpy = targety
 
71
            tmpdistance = targetz
 
72
            tmpargument = 1
 
73
            SpawnExactParticle
 
74
      Else
 
75
        tmpargument = 50                        // Too advanced of a spell
 
76
        SetReloadTime
 
77
        tmpargument = 1
 
78
        SendMessageNear
 
79
        tmpargument = 0
 
80
        SetContent
 
81
  Else
 
82
    GetContent
 
83
    tmpx = tmpargument
 
84
    tmpy = 0
 
85
    IfXIsMoreThanY
 
86
      tmpargument = 1536
 
87
      IfContentIs
 
88
        SetTargetToWhoeverIsHolding
 
89
        SetOwnerToTarget
 
90
        StopTargetMovement                      // Recoil
 
91
        tmpx = 0
 
92
        tmpy = 0
 
93
        tmpturn = targetturn + 32767
 
94
        tmpdistance = 8
 
95
        Compass
 
96
        AccelerateTarget
 
97
 
 
98
        tmpx = targetx                          // Attempt to spawn a whirlwind
 
99
        tmpy = targety
 
100
        tmpturn = targetturn
 
101
        tmpdistance = 30
 
102
        Compass
 
103
        tmpdistance = targetz + 15
 
104
        SpawnCharacterXYZ
 
105
          tmpargument = 1
 
106
          SetChildState
 
107
          EnchantChild
 
108
            tmpargument = YELLOW
 
109
            SparkleIcon
 
110
            tmpargument = 2
 
111
            SendMessageNear
 
112
          tmpargument = 0
 
113
          tmpdistance = 11025
 
114
          PlaySound
 
115
          MakeNameKnown
 
116
        Else                                    // Backfire if the spell was cast into a wall
 
117
          tmpargument = rand & 1023 + 1536
 
118
          DamageTarget
 
119
          tmpargument = 3
 
120
          SendMessageNear
 
121
 
 
122
        IfUsageIsKnown
 
123
          GetState
 
124
        Else
 
125
          tmpargument = 30
 
126
          tmpdistance = EXPSECRET
 
127
          GiveExperienceToTarget
 
128
          MakeUsageKnown
 
129
 
 
130
        tmpargument = 0
 
131
        SetContent
 
132
        tmpargument = 50
 
133
        SetReloadTime
 
134
      Else
 
135
        tmpargument = 4
 
136
        SendMessageNear
 
137
        tmpargument = 0
 
138
        SetContent
 
139
 
 
140
Else                                    // AI for the blast of wind
 
141
  IfTimeOut
 
142
    tmpx = selfspawnx
 
143
    tmpy = selfspawny
 
144
    tmpturn = rand & 65535
 
145
    tmpdistance = 200                   // Do not stray more than 200 units from home
 
146
    Compass
 
147
    ClearWaypoints
 
148
    AddWaypoint
 
149
    tmpargument = rand & 31 + 32
 
150
    SetTime
 
151
 
 
152
  IfInWater                             // Become a waterspout
 
153
    tmpargument = 1
 
154
    ChangeArmor
 
155
 
 
156
  IfCrushed
 
157
    SetTargetToSelf
 
158
      DisenchantTarget
 
159
  IfKilled
 
160
    tmpx = selfx
 
161
    tmpy = selfy
 
162
    tmpdistance = selfz
 
163
    tmpargument = 3
 
164
    SpawnExactParticle
 
165
    tmpargument = 5
 
166
    SendMessageNear
 
167
 
 
168
IfStateIs0
 
169
  IfDropped                             // Turn back into a spellbook (do last)
 
170
    tmpargument = 0
 
171
    SetContent
 
172
    BecomeSpellbook
 
173
    DisaffirmCharacter
 
174
    tmpargument = ACTIONJB
 
175
    DoActionOverride
 
176
    KeepAction
 
177
 
 
178
End