diff --git a/python/gods/altar_valkyrie.py b/python/gods/altar_valkyrie.py new file mode 100644 index 000000000..83bc37deb --- /dev/null +++ b/python/gods/altar_valkyrie.py @@ -0,0 +1,52 @@ +import Crossfire, Crossfire_Type as t + +def accept(description): + pl.Write('Valkyrie accepts your %s sacrifice!' % description) + +# XXX: need to expose NROFATTACKS to Python + +altar = Crossfire.WhoAmI() +pl = Crossfire.WhoIsActivator() +praying = pl.CheckArchInventory('skill_praying') +if praying and praying.Title == 'Valkyrie': + + # accept sacrifice + obj = altar.Above + while obj: + if obj.Type & 0xffff == t.FLESH: + factor = 0 + if obj.Level < praying.Level / 2: + pl.Write('Valkyrie scorns your pathetic sacrifice!') + elif obj.Level < praying.Level: + accept('poor') + factor = 0.5 + elif obj.Level < praying.Level * 1.5: + accept('modest') + factor = 1 + elif obj.Level < praying.Level * 2: + accept('adequate') + factor = 1.5 + elif obj.Level < praying.Level * 5: + accept('devout') + factor = 2 + else: + accept('heroic') + factor = 2.5 + + # heads and hearts are worth more. Because. + if obj.Name.endswith('head') or obj.Name.endswith('heart'): + factor *= 1.5 + + # flesh with lots of resists is worth more + res = 0 + for at in range(26): # XXX should be NROFATTACKS + res += obj.GetResist(at) + + value = max(res, 10) * factor + if obj.Quantity > 1: + obj.Quantity -= 1 + else: + obj.Remove() + pl.AddExp(value, 'praying') + break + obj = obj.Above diff --git a/scorn/misc/kboldtemp1b4 b/scorn/misc/kboldtemp1b4 index 67f593d7f..417eea9d6 100644 --- a/scorn/misc/kboldtemp1b4 +++ b/scorn/misc/kboldtemp1b4 @@ -1944,27 +1944,17 @@ arch dirtfloor x 14 y 1 end -arch silvercoin +arch altar_valkyrie x 14 y 1 end -arch kobold +arch giant exp 0 x 14 y 1 end arch dirtfloor -x 14 -y 2 -end -arch silvercoin -x 14 -y 2 -end -arch kobold -exp 0 - x 14 y 2 end @@ -1972,13 +1962,7 @@ arch dirtfloor x 14 y 3 end -arch silvercoin -x 14 -y 3 -end -arch kobold -exp 0 - +arch door_2 x 14 y 3 end @@ -1986,6 +1970,16 @@ arch dirtfloor x 14 y 4 end +arch magic_mouth +x 14 +y 4 +msg +You hear angry noises behind the door. +Whatever is in there, sounds more dangerous +than a kobold. You wonder if you should +just leave it alone. +endmsg +end arch kobold exp 0