Fix hair, dick around with new game screen.
[18plus-7leafadventure.git] / src / org / sevenchan / dongs / enchantment / Paralyze.as
blob09194c943363265504d15942f9634039950caceb
1 package org.sevenchan.dongs.enchantment
3 import flash.sampler.NewObjectSample;
4 import org.sevenchan.dongs.Creature;
5 import org.sevenchan.dongs.creature.Player;
6 import org.sevenchan.dongs.screens.CombatScreen;
7 import org.sevenchan.dongs.screens.InfoScreen;
8 /**
9 * ...
10 * @author Harbinger
12 public class Paralyze extends Enchantment
14 private var host:Creature;
15 private var turn:int = 0;
16 public function Paralyze()
20 public static function isParalyzed(subj:Creature):Boolean {;
21 return subj.hasEnchantment("paralyze");
23 override public function onInit(newHost:Creature):String
25 host = newHost;
26 cancelAddition = false;
27 if(newHost is Player) {
28 InfoScreen.push("<h2>Paralyzed</h2><p>You are now paralyzed.</p><p>Check your appearance screen to see your effects.</p>");
29 return "You are now paralyzed.";
31 var creatureRef:String = newHost.getTypeName();
32 var story:String = <![CDATA[
33 <h2>Morel Dust</h2>
34 <p>
35 You jam your hand into your pack and withdraw a small clay jar. Judging its weight and eyeing {the [CREATURE]}. %CSUB% eyes you
36 right back, albeit wary of the container in your hand, and equally wary of your darkening expression.
37 </p>
38 <p>
39 Without warning, you throw the jar at %CSUB%, and ]]>.toString();
40 if(newHost.speed > 0.25){
41 story += "reacting quickly, the "+creatureRef+" rolls out of the way as the jar strikes the ground";
42 } else {
43 if(newHost.arms.length == 0 || isParalyzed(newHost))
44 story+="being unable to move";
45 else
46 story += "having poor reaction time";
47 story += ", the jar smashes into %POS% arm";
49 story += <![CDATA[ and shatters, releasing the powder into the air in a small black explosion.
50 </p>
51 <p>
52 %CSUB% immediately goes limp and collapses to the ground, paralyzed from the morel dust's effects.
53 </p>
54 ]]>.toString();
55 newHost.gender.doReplace(story);
56 return "The " + creatureRef + " is now paralyzed.";
59 override public function onMyCombatTurn(screen:CombatScreen,other:Creature):Boolean
61 turn++;
62 trace("Paralyze.onMyCombatTurn()")
63 if (turn>=3)
65 remove();
67 return super.onMyCombatTurn(screen,other);
70 override public function onCombatComplete(hostWon:Boolean, other:Creature):void
72 remove();
75 private function remove():void {
76 InfoScreen.push("<h2>NOT Paralyzed</h2><p>You are no longer paralyzed.</p>");
77 delete host.enchantments[getID()];
80 override public function getID():String
82 return "paralyze";