RuneHive-Game
Loading...
Searching...
No Matches
Projectile.java
Go to the documentation of this file.
1package com.runehive.game;
2
3import com.runehive.game.world.World;
4import com.runehive.game.world.entity.mob.Mob;
5import com.runehive.game.world.position.Position;
6
7public class Projectile {
8
9 /** Magic combat projectile delays. */
10 public static final int[] MAGIC_DELAYS = { 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5 };
11
12 /** Ranged combat projectile delays. */
13 public static final int[] RANGED_DELAYS = { 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4 };
14
15 private int id;
16 private int delay;
17 private int duration;
18 private int startHeight;
19 private int endHeight;
20 private int curve;
21 private int distance;
22 private int offsetX;
23 private int offsetY;
24
36
37 public Projectile(int id, int delay, int duration, int startHeight, int endHeight, int curve, int distance) {
39 }
40
41 public Projectile(int id, int delay, int duration, int startHeight, int endHeight, int curve) {
43 }
44
45 public Projectile(int id, int delay, int duration, int startHeight, int endHeight) {
47 }
48
49 public Projectile(int id) {
50 this(id, 51, 68, 43, 31);
51 }
52
53 public void send(Mob source, Mob target) {
54 World.sendProjectile(source, target, this);
55 }
56
57 public void send(Mob source, Position target) {
58 World.sendProjectile(source, target, this);
59 }
60
61 public int getId() {
62 return id;
63 }
64
65 public void setId(int id) {
66 this.id = id;
67 }
68
69 public int getDelay() {
70 return delay;
71 }
72
73 public void setDelay(int delay) {
74 this.delay = delay;
75 }
76
77 public int getDuration() {
78 return duration;
79 }
80
81 public void setDuration(int duration) {
82 this.duration = duration;
83 }
84
85 public int getStartHeight() {
86 return startHeight;
87 }
88
89 public void setStartHeight(int startHeight) {
90 this.startHeight = startHeight;
91 }
92
93 public int getEndHeight() {
94 return endHeight;
95 }
96
97 public void setEndHeight(int endHeight) {
98 this.endHeight = endHeight;
99 }
100
101 public int getCurve() {
102 return curve;
103 }
104
105 public void setCurve(int curve) {
106 this.curve = curve;
107 }
108
109 public int getDistance() {
110 return distance;
111 }
112
113 public void setDistance(int distance) {
114 this.distance = distance;
115 }
116
117 public int getOffsetX() {
118 return offsetX;
119 }
120
121 public void setOffsetX(int offsetX) {
122 this.offsetX = offsetX;
123 }
124
125 public int getOffsetY() {
126 return offsetY;
127 }
128
129 public void setOffsetY(int offsetY) {
130 this.offsetY = offsetY;
131 }
132
136
137 public int getClientTicks() {
138 return /*getDelay() + */getDuration();
139 }
140
141}
void setStartHeight(int startHeight)
void send(Mob source, Mob target)
void setEndHeight(int endHeight)
void setOffsetY(int offsetY)
void setOffsetX(int offsetX)
Projectile(int id, int delay, int duration, int startHeight, int endHeight, int curve, int distance, int offsetX, int offsetY)
Projectile(int id, int delay, int duration, int startHeight, int endHeight, int curve, int distance)
void setDuration(int duration)
static final int[] MAGIC_DELAYS
Magic combat projectile delays.
void setDistance(int distance)
void send(Mob source, Position target)
Projectile(int id, int delay, int duration, int startHeight, int endHeight, int curve)
static final int[] RANGED_DELAYS
Ranged combat projectile delays.
Projectile(int id, int delay, int duration, int startHeight, int endHeight)
Represents the game world.
Definition World.java:46
static void sendProjectile(Projectile projectile, Position position, int instance, int lock, byte offsetX, byte offsetY)
Sends a world projectile.
Definition World.java:295
Handles the mob class.
Definition Mob.java:66
Represents a single tile on the game world.
Definition Position.java:14