RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
Projectile.java
1package com.osroyale.game;
2
3import com.osroyale.game.world.World;
4import com.osroyale.game.world.entity.mob.Mob;
5import com.osroyale.game.world.position.Position;
6
43
44public class Projectile {
45
47 public static final int[] MAGIC_DELAYS = { 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5 };
48
50 public static final int[] RANGED_DELAYS = { 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4 };
51
52 private int id;
53 private int delay;
54 private int duration;
55 private int startHeight;
56 private int endHeight;
57 private int curve;
58 private int distance;
59 private int offsetX;
60 private int offsetY;
61
62 public Projectile(int id, int delay, int duration, int startHeight, int endHeight, int curve, int distance, int offsetX, int offsetY) {
63 setId(id);
64 setDelay(delay);
65 setDuration(duration);
66 setStartHeight(startHeight);
67 setEndHeight(endHeight);
68 setCurve(curve);
69 setDistance(distance);
70 setOffsetX(offsetX);
71 setOffsetY(offsetY);
72 }
73
74 public Projectile(int id, int delay, int duration, int startHeight, int endHeight, int curve, int distance) {
75 this(id, delay, duration, startHeight, endHeight, curve, distance, 0, 0);
76 }
77
78 public Projectile(int id, int delay, int duration, int startHeight, int endHeight, int curve) {
79 this(id, delay, duration, startHeight, endHeight, curve, 64);
80 }
81
82 public Projectile(int id, int delay, int duration, int startHeight, int endHeight) {
83 this(id, delay, duration, startHeight, endHeight, 16);
84 }
85
86 public Projectile(int id) {
87 this(id, 51, 68, 43, 31);
88 }
89
90 public void send(Mob source, Mob target) {
91 World.sendProjectile(source, target, this);
92 }
93
94 public void send(Mob source, Position target) {
95 World.sendProjectile(source, target, this);
96 }
97
98 public int getId() {
99 return id;
100 }
101
102 public void setId(int id) {
103 this.id = id;
104 }
105
106 public int getDelay() {
107 return delay;
108 }
109
110 public void setDelay(int delay) {
111 this.delay = delay;
112 }
113
114 public int getDuration() {
115 return duration;
116 }
117
118 public void setDuration(int duration) {
119 this.duration = duration;
120 }
121
122 public int getStartHeight() {
123 return startHeight;
124 }
125
126 public void setStartHeight(int startHeight) {
127 this.startHeight = startHeight;
128 }
129
130 public int getEndHeight() {
131 return endHeight;
132 }
133
134 public void setEndHeight(int endHeight) {
135 this.endHeight = endHeight;
136 }
137
138 public int getCurve() {
139 return curve;
140 }
141
142 public void setCurve(int curve) {
143 this.curve = curve;
144 }
145
146 public int getDistance() {
147 return distance;
148 }
149
150 public void setDistance(int distance) {
151 this.distance = distance;
152 }
153
154 public int getOffsetX() {
155 return offsetX;
156 }
157
158 public void setOffsetX(int offsetX) {
159 this.offsetX = offsetX;
160 }
161
162 public int getOffsetY() {
163 return offsetY;
164 }
165
166 public void setOffsetY(int offsetY) {
167 this.offsetY = offsetY;
168 }
169
170 public Projectile copy() {
171 return new Projectile(id, delay, duration, startHeight, endHeight, curve, distance, offsetX, offsetY);
172 }
173
174 public int getClientTicks() {
175 return /*getDelay() + */getDuration();
176 }
177
178}
static final int[] RANGED_DELAYS
static final int[] MAGIC_DELAYS