[common] add gun bonus
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tankz",
|
||||
"version": "0.8.10",
|
||||
"version": "0.8.11",
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"dateformat": "^3.0.3",
|
||||
|
||||
|
Before Width: | Height: | Size: 566 B After Width: | Height: | Size: 8.9 KiB |
BIN
src/client/resources/image/bonus/gun.png
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 541 B After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 455 B After Width: | Height: | Size: 8.6 KiB |
|
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 374 B After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 612 B |
|
Before Width: | Height: | Size: 737 B After Width: | Height: | Size: 365 B |
@@ -52,12 +52,12 @@ class CollisionProcessor {
|
||||
// Nothing
|
||||
} else {
|
||||
if (!tank.protect.active) {
|
||||
if (tank.config.downgrade != null) {
|
||||
tank.config = engine.config.getTank(tank.config.downgrade);
|
||||
engine.change(tank, TYPE);
|
||||
} else if (tank.hits > 0) {
|
||||
if (tank.hits > 0) {
|
||||
tank.hits--;
|
||||
engine.change(tank, HIT);
|
||||
} else if (tank.config.downgrade != null) {
|
||||
tank.config = engine.config.getTank(tank.config.downgrade);
|
||||
engine.change(tank, TYPE);
|
||||
} else {
|
||||
engine.destroy(tank, bullet.tank.playerId);
|
||||
}
|
||||
|
||||
@@ -323,6 +323,16 @@ class Game extends GameDispatcher {
|
||||
eagle.protect.on(bonus.config.duration);
|
||||
engine.change(eagle, EntityChange.PROTECT);
|
||||
}
|
||||
case 'gun':
|
||||
if (tank.config.upgrade != null) {
|
||||
while (tank.config.upgrade != null) {
|
||||
tank.config = config.getTank(tank.config.upgrade);
|
||||
}
|
||||
engine.change(tank, EntityChange.TYPE);
|
||||
} else {
|
||||
tank.hits++;
|
||||
engine.change(tank, EntityChange.HIT);
|
||||
}
|
||||
case _:
|
||||
engine.destroy(tank); // :-D
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ player:
|
||||
color: 0xFFFFFF
|
||||
bonus: 0.25
|
||||
tanks:
|
||||
- {type: bot0, rate: 0.25}
|
||||
- {type: bot1, rate: 0.25}
|
||||
- {type: bot2, rate: 0.25}
|
||||
- {type: bot3, rate: 0.25}
|
||||
- {type: bot0, rate: 0.30}
|
||||
- {type: bot1, rate: 0.28}
|
||||
- {type: bot2, rate: 0.27}
|
||||
- {type: bot3, rate: 0.15}
|
||||
|
||||
presets:
|
||||
# player1
|
||||
@@ -117,7 +117,7 @@ tanks:
|
||||
skin: pc
|
||||
|
||||
- type: human3
|
||||
upgrade: human3
|
||||
# upgrade: human3
|
||||
downgrade: human2
|
||||
width: 42
|
||||
height: 38
|
||||
@@ -181,4 +181,4 @@ bonuses:
|
||||
- {score: 500, type: life}
|
||||
- {score: 500, type: shovel, duration: 10}
|
||||
- {score: 500, type: star}
|
||||
|
||||
- {score: 500, type: gun}
|
||||
|
||||