File: spell_arrow.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 (19 lines) | stat: -rw-r--r-- 552 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import Crossfire

who = Crossfire.WhoAmI()
victim = Crossfire.WhoIsOther();

spells = who.ReadKey("arrow_spell")
if spells and victim:
    spells = spells.split(";")
    for spell in spells:
        if ":" in spell:
            quantity, archetype = spell.split(":")
        else:
            quantity = 1
            archetype = spell
        spellob = Crossfire.CreateObjectByName(archetype)
        if spellob:
            for r in range(0, int(quantity)):
                victim.Cast(spellob, 0, "")
            spellob.Remove()