1 package org
.sevenchan
.dongs
.screens
3 import org
.sevenchan
.AdventureController
;
4 import org
.sevenchan
.dongs
.Creature
;
5 import org
.sevenchan
.dongs
.Screen;
6 import org
.sevenchan
.dongs
.Item
;
12 public class WinnerScreen
extends Screen
14 public static var immediatelyConsume
:Boolean = false;
15 private var player
:Creature
;
16 private var loser
:Creature
;
19 public static function push
(ply
:Creature
, loser
:Creature
):void {
20 AdventureController
.screenQueue
.write
(new WinnerScreen
(ply
, loser
));
22 public function WinnerScreen
(ply
:Creature
,loser
:Creature
)
28 setButton
(NEXT_BUTTON
, "Next");
31 override public function getScreenText
():String
33 var text
:String = "<h2>You won!</h2><p>You received:<ul>";
34 trace
("LOSER INVENTORY");
35 for each (var item
:Item
in loser
.inventory
) {
36 if(player
.inventoryUpdate
(item
,true)) {
37 text
+= "<li>" + item
.amount
+ "x " + item
.name
+ "</li>";
38 player
.addToInventory
(item
);
41 text
+= "<li>" + loser
.gold
+ " gold</li>";
42 text
+= "<li>" + (6+((player
.level
- loser
.level
)*1)) + " XP</li>";
44 //player.gold += loser.gold;