Added script specific to moving fog
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@13634 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
7bd104454a
commit
b96c83f823
|
@ -0,0 +1,11 @@
|
|||
import Crossfire,random,math
|
||||
Params=Crossfire.ScriptParameters()
|
||||
if Params=="Fog":
|
||||
whoami=Crossfire.WhoAmI()
|
||||
Rand=random.randint(0,8)
|
||||
if Rand!=0:
|
||||
whoami.Move(Rand)
|
||||
|
||||
whoami.Weight-=1
|
||||
if whoami.Weight>=0:
|
||||
Crossfire.SetReturnValue(1)
|
|
@ -0,0 +1,40 @@
|
|||
import Crossfire,random,math
|
||||
whoami=Crossfire.WhoAmI()
|
||||
Params=Crossfire.ScriptParameters()
|
||||
|
||||
if Params=="GenerateFog":
|
||||
|
||||
Fogs=int(whoami.Weight/1000)
|
||||
Fogs=max(Fogs,1)
|
||||
a=whoami.Inventory
|
||||
while a !=None:
|
||||
a.Remove()
|
||||
a=whoami.Inventory
|
||||
FogsTmp=Fogs
|
||||
if whoami.Name=="fog":
|
||||
FogsTmp=whoami.Value
|
||||
if Fogs > 50:
|
||||
z=whoami.CreateObject("temp_fog")
|
||||
Z=z.CreateObject("event_destroy")
|
||||
Z.Name="PuddleDeath"
|
||||
Z.Title="Python"
|
||||
Z.Slaying="/python/pshop/Ice.py"
|
||||
z.Weight=(Fogs-50)*1000
|
||||
Fogs=50
|
||||
z.Speed*=2
|
||||
z.Value=FogsTmp
|
||||
|
||||
for i in range(Fogs):
|
||||
|
||||
z=whoami.CreateObject("temp_fog")
|
||||
z.Speed+=0.01
|
||||
z.Weight=(3+random.randint(1,10+int(math.sqrt(FogsTmp))))*1
|
||||
Rand=random.randint(1,2+int(FogsTmp/10))
|
||||
z.Speed*=Rand
|
||||
z.Weight*=int(Rand/10)+1
|
||||
|
||||
y=z.CreateObject("event_time")
|
||||
y.Name="Fog"
|
||||
y.Title="Python"
|
||||
y.Slaying="/python/Move_Fog.py"
|
||||
z.Speed/=3
|
Loading…
Reference in New Issue