Skip to content

Commit

Permalink
Specify attack type
Browse files Browse the repository at this point in the history
  • Loading branch information
NotThorny committed Oct 13, 2022
1 parent be714f2 commit 4f528ac
Showing 1 changed file with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public void execute(Player sender, Player targetPlayer, List<String> args) {
var pos = targetPlayer.getPosition();
var rot = targetPlayer.getRotation();
int thing = Integer.parseInt(args.get(0));


EntityGadget entity = new EntityGadget(scene, thing, pos, rot);
scene.addEntity(entity);
Expand All @@ -43,17 +44,21 @@ public void execute(Player sender, Player targetPlayer, List<String> args) {
public static void addAttack(GameSession session, int skillId){

int addedAttack = 0; // Default of no gadget
String attType = ""; // Default of no type

// Currently will only damage the player
switch (skillId) { // For Raiden
case 10521: // Basic attack
addedAttack = 42906105;
attType = "basic";
break;
case 10522: // Elemental skill
addedAttack = 42906108;
attType = "elemental";
break;
case 10525: // Burst
addedAttack = 42906119;
attType = "burst";
break;
default:
// Do nothing
Expand All @@ -69,8 +74,12 @@ public static void addAttack(GameSession session, int skillId){
// Try to set position in front of player to not get hit
double angle = rot.getY();
Position target = new Position(pos);
target.addX((float) (r * Math.sin(Math.PI/180 * angle)));
target.addZ((float) (r * Math.cos(Math.PI/180 * angle)));

// Only change gadget pos for basic attack
if(attType.equals("basic")){
target.addX((float) (r * Math.sin(Math.PI/180 * angle)));
target.addZ((float) (r * Math.cos(Math.PI/180 * angle)));
}

// Only spawn on match
if(addedAttack != 0){
Expand Down Expand Up @@ -104,8 +113,6 @@ public static void addAttack(GameSession session, int skillId){
// Remove gadgets and clean list
activeGadgets.removeAll(removeGadgets);
removeGadgets.clear();
}
//activeGadgets.removeAll(removeGadgets);
//removeGadgets.clear();
}
}
} // if
} // addAttack
} // AttackModifierCommand

0 comments on commit 4f528ac

Please sign in to comment.