1 package org
.sevenchan
.dongs
.enchantment
3 import flash
.net
.registerClassAlias
;
4 import org
.sevenchan
.dongs
.Creature
;
5 import org
.sevenchan
.dongs
.creature
.Demon
;
6 import org
.sevenchan
.dongs
.creature
.Player
;
7 import org
.sevenchan
.dongs
.screens
.InfoScreen
;
9 * Oh look I made an STD
12 public class Corruption
extends Enchantment
14 registerClassAlias
("ECorruption", Corruption
);
15 public var level
:Number;
16 public var host
:Creature
;
17 public function Corruption
(amt
:Number)
23 override public function getName
():String
28 override public function getDescr
():String
30 return "Then John was the demons. Current level: " + level
;
33 override public function onInit
(newHost
:Creature
):String
38 cancelAddition
= true;
39 delete newHost
.enchantments
[getID
()];
40 return "You are no longer corrupted.";
42 if (newHost
.enchantments
[getID
()] != null) {
43 (newHost
.enchantments
[getID
()] as Corruption
).level
+= level
;
44 cancelAddition
= true;
48 (host
as Player
).changeTo
(new Demon
());
50 var oldHost
:Creature
= host
;
52 host
.changeFrom
(oldHost
);
56 return "Your corruption level has increased to level "+getLevelOf
(newHost
)+".";
59 var ply
:Player
= Player
(host
);
60 if (!ply
.getExplored
("corruptionintro")) {
61 ply
.setExplored
("corruptionintro");
62 InfoScreen
.push
("<h2>Corrupted</h2><p>You are now " + level
+ "% corrupted. If this reaches 100%, you will become a Demon.</p><p>Check your appearance screen to see your effects.</p>");
65 return "You are now corrupted.";
67 if (statbar
== null && host
is Player
) {
68 statbar
= (newHost
as Player
).AdventureController
.createNewStatusBar
();
72 public static function getLevelOf
(host
:Creature
):Number {
73 if (host
.enchantments
["corruption"] != null)
74 return (host
.enchantments
["corruption"] as Corruption
).level
;
78 override public function onCombatComplete
(hostWon
:Boolean, other
:Creature
):void
82 override public function getID
():String