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

« back to all changes in this revision

Viewing changes to modules/elf.mod/objects/morph.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
// Create the character
 
2
IfSpawned
 
3
  // It's an imported spell in hand
 
4
  tmpargument = 0
 
5
  SetState
 
6
  KeepAction
 
7
IfChanged
 
8
  IfCharacterWasABook  // Did it start out as a book or the spell object?
 
9
    // It's a spell in hand
 
10
    tmpargument = 0
 
11
    SetState
 
12
    KeepAction
 
13
  Else
 
14
    // It's a morphed character
 
15
    SpawnPoof
 
16
    tmpargument = 1
 
17
    SetState
 
18
 
 
19
 
 
20
// Monster AI...  State 1
 
21
IfStateIs1
 
22
  // Boredom
 
23
  IfBored
 
24
    tmpargument = ACTIONMC
 
25
    DoAction
 
26
    tmpargument = rand & 1 + 3
 
27
    tmpdistance = rand & 2047 + 10000
 
28
    PlaySound
 
29
 
 
30
 
 
31
  // Character screams
 
32
  IfAttacked
 
33
    tmpargument = rand & 1 + 5
 
34
    tmpdistance = rand & 2047 + 10000
 
35
    PlaySound
 
36
 
 
37
 
 
38
 
 
39
// Spell AI...  State 0
 
40
Else
 
41
  // Remove the charge
 
42
  IfTakenOut
 
43
    tmpargument = 0
 
44
    SetContent
 
45
    SetTargetToWhoeverIsHolding
 
46
      IfTargetIsAPlayer
 
47
        tmpargument = 3
 
48
        IfNameIsKnown
 
49
          tmpargument = 4
 
50
        SendMessageNear
 
51
  // Allow it to be charged up
 
52
  IfUsed
 
53
    // Does it have one going?
 
54
    UndoEnchant
 
55
      tmpargument = 60
 
56
      SetReloadTime
 
57
    // Nope, so charge
 
58
    Else
 
59
      GetContent
 
60
      tmpx = tmpargument
 
61
      tmpy = 380
 
62
      IfXIsLessThanY
 
63
        SetTargetToWhoeverIsHolding
 
64
        tmpargument = [WMAG]
 
65
        IfTargetHasSkillID
 
66
          tmpy = targetmanaflow
 
67
          IfXIsLessThanY
 
68
            tmpx = 8
 
69
            tmpargument = tmpx
 
70
            CostTargetMana
 
71
              GetContent
 
72
              tmpargument = tmpargument + 4
 
73
              SetContent
 
74
              tmpx = selfx
 
75
              tmpy = selfy
 
76
              tmpdistance = selfz
 
77
              tmpargument = 5
 
78
              SpawnExactParticle
 
79
 
 
80
 
 
81
  // Let it be cast
 
82
  Else
 
83
    GetContent
 
84
    tmpx = tmpargument
 
85
    tmpy = 0
 
86
    IfXIsMoreThanY
 
87
      tmpy = 379
 
88
      IfXIsMoreThanY
 
89
        // Cast the spell...
 
90
        UndoEnchant  // There can be only one
 
91
        SetTargetToWhoeverIsHolding
 
92
        SetOwnerToTarget
 
93
        EnchantTarget
 
94
          MakeUsageKnown
 
95
          MakeNameKnown
 
96
          tmpargument = GREEN
 
97
          SparkleIcon
 
98
          tmpargument = 2
 
99
          SendMessageNear
 
100
        Else
 
101
          tmpargument = 1
 
102
          SendMessageNear
 
103
 
 
104
 
 
105
        // Do flashy things
 
106
        tmpargument = 2
 
107
        tmpdistance = 22050
 
108
        PlaySound
 
109
        tmpargument = 60
 
110
        SetReloadTime
 
111
 
 
112
 
 
113
      // Nothing happens...
 
114
      Else
 
115
        tmpargument = 0
 
116
        SendMessageNear
 
117
 
 
118
 
 
119
      // Reset the charge counter
 
120
      tmpargument = 0
 
121
      SetContent
 
122
 
 
123
 
 
124
  // Return to spellbook, Do last!
 
125
  IfDropped
 
126
    tmpargument = 0
 
127
    SetContent
 
128
    BecomeSpellbook
 
129
    DisaffirmCharacter
 
130
    tmpargument = ACTIONJB
 
131
    DoAction
 
132
    KeepAction
 
133
End