diff options
Diffstat (limited to 'NET/worlds/scape/HighJump.java')
| -rw-r--r-- | NET/worlds/scape/HighJump.java | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/NET/worlds/scape/HighJump.java b/NET/worlds/scape/HighJump.java new file mode 100644 index 0000000..3e81b76 --- /dev/null +++ b/NET/worlds/scape/HighJump.java @@ -0,0 +1,97 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.console.Main; +/* */ import NET.worlds.console.MainCallback; +/* */ import NET.worlds.core.Std; +/* */ import java.util.Enumeration; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class HighJump +/* */ extends InventoryAction +/* */ implements MainCallback +/* */ { +/* */ int start; +/* */ SmoothDriver sd; +/* */ +/* */ public HighJump(String id, String name) +/* */ { +/* 25 */ super(id, name); +/* */ } +/* */ +/* */ public HighJump(String id, String name, int qty) +/* */ { +/* 30 */ super(id, name, qty); +/* */ } +/* */ +/* */ public HighJump(HighJump in) +/* */ { +/* 35 */ super(in); +/* */ } +/* */ +/* */ public InventoryItem cloneItem() +/* */ { +/* 40 */ return new HighJump(this); +/* */ } +/* */ +/* */ private SmoothDriver findSD(Pilot p) +/* */ { +/* 45 */ for (Enumeration<Object> e = p.getHandlers(); e.hasMoreElements();) +/* */ { +/* 47 */ Object o = e.nextElement(); +/* 48 */ if ((o instanceof SmoothDriver)) { +/* 49 */ return (SmoothDriver)o; +/* */ } +/* */ } +/* 52 */ return null; +/* */ } +/* */ +/* */ public boolean doAction() +/* */ { +/* 57 */ if (this.itemQuantity_ > 0) +/* */ { +/* 59 */ Pilot p = Pilot.getActive(); +/* 60 */ if (p == null) { +/* 61 */ return false; +/* */ } +/* */ +/* 64 */ this.sd = findSD(p); +/* 65 */ if (this.sd == null) +/* 66 */ return false; +/* 67 */ if (this.sd != null) { +/* 68 */ Main.register(this); +/* 69 */ this.start = Std.getRealTime(); +/* 70 */ this.itemQuantity_ -= 1; +/* */ } +/* 72 */ return true; +/* */ } +/* 74 */ return false; +/* */ } +/* */ +/* */ public void mainCallback() +/* */ { +/* 79 */ int now = Std.getFastTime(); +/* 80 */ if (now > this.start + 6000) +/* */ { +/* 82 */ Main.unregister(this); +/* 83 */ this.sd.setEyeHeight(150.0F); +/* */ } +/* */ else +/* */ { +/* 87 */ float t = 1.0F - (float)Math.pow(1.0F - (now - this.start) / 3000.0F, 4.0D); +/* 88 */ this.sd.setEyeHeight(150.0F + 150.0F * t); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\HighJump.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |