RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
ProjectileTest.java
1package com.osroyale.game;
2
3import com.osroyale.game.world.entity.mob.Mob;
4import com.osroyale.game.world.position.Position;
5
6public class ProjectileTest {
7
8 Position start, target, offset;
9 private final int creatorSize, startDistanceOffset, lockon, delay, startHeight, endHeight, projectileId, speed, slope, angle, radius, stepMultiplier;
10
11 public ProjectileTest(Position start, Position end, int lockon,
12 int projectileId, int speed, int delay, int startHeight, int endHeight,
13 int curve, int creatorSize, int startDistanceOffset, int stepMultiplier) {
14 this.start = start;
15 this.target = end;
16 this.offset = new Position((end.getX() - start.getX()),
17 (end.getY() - start.getY()));
18 this.creatorSize = creatorSize;
19 this.startDistanceOffset = startDistanceOffset;
20 this.lockon = lockon;
21 this.projectileId = projectileId;
22 this.delay = delay;
23 this.speed = speed;
24 this.startHeight = startHeight;
25 this.endHeight = endHeight;
26 this.slope = curve;
27 this.angle = getAngle();
28 this.radius = getRadius();
29 this.stepMultiplier = stepMultiplier;
30 }
31
32 public ProjectileTest(Mob source, Mob victim, int projectileId,
33 int delay, int speed, int startHeight, int endHeight, int curve, int creatorSize, int stepMultiplier) {
34 this(source.getPosition(), victim.getPosition(),
35 (victim.isPlayer() ? -victim.getIndex() - 1
36 : victim.getIndex() + 1), projectileId, speed, delay,
37 startHeight, endHeight, curve, creatorSize, 64, stepMultiplier);
38 }
39
40 public ProjectileTest(Position start, Position end, int lockon,
41 int projectileId, int speed, int delay, int startHeight, int endHeight,
42 int curve) {
43 this(start, end, lockon, projectileId, speed, delay, startHeight, endHeight, curve, 1, 0, 0);
44 }
45
46 public ProjectileTest(Position source, Position delta, int slope, int speed, int projectileId, int startHeight, int endHeight, int lockon, int delay, int creatorSize, int startDistanceOffset) {
47 this(source, delta, lockon, projectileId, speed, delay, startHeight, endHeight, slope, creatorSize, startDistanceOffset, 0);
48 }
49
50 public int getLockon() {
51 return this.lockon;
52 }
53
54 public int getProjectileId() {
55 return this.projectileId;
56 }
57
58 public int getStepMultiplier() {
59 return stepMultiplier;
60 }
61
62 public int getSlope() {
63 return this.slope;
64 }
65
66 public int getEndHeight() {
67 return this.endHeight;
68 }
69
70 public int getStartHeight() {
71 return this.startHeight;
72 }
73
74 public int getSpeed() {
75 return this.speed;
76 }
77
78 public int getDelay() {
79 return this.delay;
80 }
81
82 public int getCreatorSize() {
83 return this.creatorSize;
84 }
85
86 public Position getOffset() {
87 return this.offset;
88 }
89
90 public int getStartDistanceOffset() {
91 return this.startDistanceOffset;
92 }
93
94 public Position getStart() {
95 return this.start;
96 }
97
98 public Position getTarget() {
99 return this.target;
100 }
101
102 public int getAngle() {
103 return this.angle;
104 }
105
106 public int getRadius() {
107 return this.radius;
108 }
109
110 public int getDuration(int distance) {
111 if (distance > 0) {
112 return this.delay + (distance * this.stepMultiplier);
113 }
114 return 0;
115 }
116
117 public int getHitDelay(int distance) {
118 return (int) Math.floor(getDuration(distance) / 30D) + 1; //might be - 1
119 }
120}
121