Skip to content

Commit

Permalink
Merge branch 'main' into Team6--projectile
Browse files Browse the repository at this point in the history
  • Loading branch information
V4N5HM authored Oct 17, 2023
2 parents 7a4b609 + 5b6ab27 commit b293cc4
Show file tree
Hide file tree
Showing 15 changed files with 404 additions and 38 deletions.
20 changes: 10 additions & 10 deletions source/core/assets/configs/tower.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@
"income": {
"health": 10,
"baseAttack": 0,
"cost": 10
"cost": 100
},
"wall": {
"health": 300,
"baseAttack": 0,
"cost": 45
"cost": 200
},
"TNTTower": {
"health": 10,
"baseAttack": 5,
"cost": 30
"cost": 50
},
"weapon": {
"health": 75,
"baseAttack": 15,
"cost": 15
"cost": 50
},
"DroidTower": {
"health": 100,
"baseAttack": 25,
"cost": 45
"cost": 300
},
"fireTower": {
"health": 100,
"baseAttack": 25,
"cost": 45
"cost": 300
},
"stunTower": {
"health": 100,
"baseAttack": 25,
"cost": 45
"cost": 500
},
"fireworksTower": {
"health": 125,
"baseAttack": 45,
"cost": 70
"cost": 500
},
"pierceTower": {
"health": 125,
"baseAttack": 45,
"cost": 70
"cost": 500
},
"ricochetTower": {
"health": 125,
"baseAttack": 45,
"cost": 70
"cost": 500
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class CurrencyTask extends DefaultTask implements PriorityTask {
private long endTime;
private int interval;
private final Scrap scrap = new Scrap(); // currency to update
private final int currencyAmount = 30; // amount of currency to update
private final int currencyAmount = 10; // amount of currency to update
private static final String IDLE = "idleStartEco";
private static final String MOVE = "moveStartEco";
private static final String DEATH = "deathStartEco";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ public int getPriority() {
*/
public boolean isTargetVisible() {
// If there is an obstacle in the path to the max range point, mobs visible.
return physics.raycast(towerPosition, maxRangePosition, TARGET, hit);
boolean top = physics.raycast(towerPosition.add(0f,0.4f), maxRangePosition.add(0f,0.4f), TARGET, hit);
boolean bottom = physics.raycast(towerPosition.sub(0f,0.4f), maxRangePosition.sub(0f,0.4f), TARGET, hit);
return top || bottom;
}

private void changeFireRateInterval(int newInterval) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ public int getInactivePriority() {
* @return true if mobs are present and false otherwise.
*/
public boolean isTargetVisible() {
return physics.raycast(towerPosition, maxRangePosition, TARGET, hit);
boolean top = physics.raycast(towerPosition.add(0f,0.4f), maxRangePosition.add(0f,0.4f), TARGET, hit);
boolean bottom = physics.raycast(towerPosition.sub(0f,0.4f), maxRangePosition.sub(0f,0.4f), TARGET, hit);
return top || bottom;
}

private void changeFireRateInterval(int newInterval) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ public int getPriority() {
* @return true if targets are detected, false otherwise
*/
public boolean isTargetVisible() {
return physics.raycast(towerPosition, maxRangePosition, TARGET, hit);
boolean top = physics.raycast(towerPosition.add(0f,0.4f), maxRangePosition.add(0f,0.4f), TARGET, hit);
boolean bottom = physics.raycast(towerPosition.sub(0f,0.4f), maxRangePosition.sub(0f,0.4f), TARGET, hit);
return top || bottom;
}

/**
Expand Down
Loading

0 comments on commit b293cc4

Please sign in to comment.