File: smoking_pipe.py

package info (click to toggle)
crossfire-maps 1.75.0%2Bdfsg1-1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 275,656 kB
  • sloc: python: 7,711; sql: 92; sh: 73; makefile: 7
file content (34 lines) | stat: -rw-r--r-- 698 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import Crossfire

# archetype that'll be smoked
smoke_what = 'pipeweed'
color = Crossfire.MessageFlag.NDI_BLUE

def smoke():
	if who.Type != Crossfire.Type.PLAYER:
		return
	what = who.Inventory
	while what:
		if what.ArchName == smoke_what:
			break
		what = what.Below
	if what == None:
		who.Write('You don\'t have anything to smoke.', color)
		return

	what.Quantity = what.Quantity - 1
	force = who.CreateObject('force_effect')
	force.Speed = 0.1
	force.Duration = 50
	force.Con = -2
	force.Dex = -2
	force.Applied = 1
	force.SetResist(Crossfire.AttackTypeNumber.FEAR, 100)
	who.ChangeAbil(force)

Crossfire.SetReturnValue(1)

me = Crossfire.WhoAmI()
who = Crossfire.WhoIsActivator()

smoke()