Debian Codegraph @

python/Moving_Fog.py

raw
1 import Crossfire,random,math
2 whoami=Crossfire.WhoAmI()
3 Params=Crossfire.ScriptParameters()
4
5 if Params=="GenerateFog":
6
7 Fogs=int(whoami.Weight/10000)
8 Fogs=max(Fogs,1)
9 a=whoami.Inventory
10 while a !=None:
11 a.Remove()
12 a=whoami.Inventory
13 FogsTmp=Fogs
14 if whoami.Name=="fog":
15 FogsTmp=whoami.Value
16 if Fogs > 50:
17 z=whoami.CreateObject("temp_fog")
18 Z=z.CreateObject("event_destroy")
19 Z.Name="PuddleDeath"
20 Z.Title="Python"
21 Z.Slaying="/python/pshop/Ice.py"
22 z.Weight=(Fogs-50)*1000
23 Fogs=50
24 z.Speed*=2
25 z.Value=FogsTmp
26
27 for i in range(Fogs):
28
29 z=whoami.CreateObject("temp_fog")
30 z.Speed+=0.05
31 z.Weight=(0+random.randint(1,15+int(math.sqrt(FogsTmp))))*1
32 Rand=random.randint(1,2+int(FogsTmp/10))
33 z.Speed*=Rand
34 z.Weight*=int(Rand/10)+1
35
36 y=z.CreateObject("event_time")
37 y.Name="Fog"
38 y.Title="Python"
39 y.Slaying="/python/Move_Fog.py"
40 z.Speed/=3
41 z.Weight=z.Weight//3