Files
DiamondHollowII/research/inner_decompiled/scripts/com/arc/dh/menu/Equipment.as
T

97 lines
3.3 KiB
ActionScript

package com.arc.dh.menu
{
import com.arc.dh.util.Data;
import com.arc.flixel.ArcGroup;
import com.arc.flixel.ArcSprite;
import org.flixel.FlxBitmapText;
import org.flixel.FlxPoint;
public class Equipment extends ArcGroup
{
private static const icons:Class = Equipment_icons;
private var _name:FlxBitmapText;
private var _acquired:FlxBitmapText;
private var _skill:String;
private var _sprite:ArcSprite;
private var _item:String;
public function Equipment(param1:Number, param2:String, param3:String)
{
var _loc4_:int = param1 / 5;
var _loc5_:int = param1 % 5;
super(22 + _loc5_ * 23 + (_loc5_ > 1 ? 1 : 0),127 + _loc4_ * 23);
this._skill = param3;
this._sprite = new ArcSprite(0,0);
this._sprite.loadGraphic(icons,true,false,14,14);
this._sprite.addAnimation("item",[param1]);
this._sprite.play("item");
this.add(this._sprite);
this._item = param2;
setAll("scrollFactor",new FlxPoint(0,0));
this.sync();
}
override public function update() : void
{
if(this._sprite.hover())
{
if(Menu.tooltip == null || Menu.tooltip.source != this)
{
Menu.tooltip = new MenuTooltip(this._sprite.x + this._sprite.width / 2,this._sprite.y,this.getName().toUpperCase(),this.getDescription().toUpperCase());
Menu.tooltip.source = this;
}
Menu.hovering = true;
}
this.sync();
super.update();
}
private function getDescription() : String
{
switch(this._item)
{
case "Autofire":
return "Allows you to fire your weapon automatically. Press \'F\' to toggle.";
case "Laser Sight":
return "Creates a laser beam to aid in aiming.";
case "Sky Boots":
return "Allows you to double jump.";
case "Molten Suit":
return "Allows you to survive short periods in lava, taking damage over time.";
case "Moon Boots":
return "Allows you to triple jump.";
case "Prime Gun":
return "Shoots a steady stream of medium powered bullets.\nHotkey: 1";
case "Spreader Gun":
return "Shoots multiple spread out weak bullets.\nHotkey: 2";
case "Missile Gun":
return "Shoots high powered missiles that can break steel blocks and destroy spinning blades.\nHotkey: 3";
case "Rebound Gun":
return "Shoots medium powered bullets that bounce off\nof terrain.\nHotkey: 4";
case "X-Ray Scope":
return "Shines a scope to find hidden areas in the terrain. Cannot shoot or move while active.\nHotkey: SHIFT";
default:
return "MOTHERFUCKER";
}
}
private function getName() : String
{
return this._item;
}
public function sync() : void
{
this._sprite.alpha = Data[this._skill] == 1 ? 0.9 : 0.3;
this._sprite.alpha *= _alpha;
}
}
}