Skip to content

Commit

Permalink
configurable knockback range and attempt to align knockback with anim…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
thmsndk committed Oct 15, 2024
1 parent 73ccc28 commit 2729cec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions design/monsters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,17 +1252,16 @@
"gargoyle":{"name":"Gargoyle","speed":6,"charge":12,"hp":100,"xp":100,"attack":5,"damage_type":"physical","respawn":1,"gold":20,"range":15,"frequency":0.4,"aggro":0,"aa":1,},
"gwyvern":{"name":"Wyvern","speed":6,"charge":12,"hp":4000000,"xp":100,"attack":5,"damage_type":"physical","respawn":1,"gold":20,"range":15,"frequency":0.4,"aggro":0,"aa":1,
"abilities":{
# TODO: Frontal Cleave
# Frontal Cleave - 90-degree spread in the forward direction
"frontal_cleave":{
# Frontal Cleave - 90-degree spread in the forward direction
"polygon": {"shape": "sector", "angleRange": 90},
"cooldown":10000,"radius":175
"cooldown":10000,"radius":100
},
# Wing Knockback - 270-degree spread around the back and sides
"wing_flap":{
# Wing Knockback - 270-degree spread around the back and sides
"polygon": {"shape": "sector", "angleRange": 270, "angleOffset": 180},
"knockback": True,
"cooldown":5000,"radius":175
"knockback": 200,
"cooldown":20000,"radius":100
},
# Kinda weird it calls it on repeat on cooldown
}},
Expand Down
4 changes: 2 additions & 2 deletions node/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -11763,7 +11763,7 @@ function update_instance(instance) {
if (is_point_inside([player.x, player.y], polygon)) {
console.log(`${player.name} is inside the polygon!`);
if (ability.knockback) {
const knockbackPoints = knockback(player, monster, 250);
const knockbackPoints = knockback(player, monster, ability.knockback);
// TODO: We can also supply an effect to transport?
transport_player_to(player, monster.map, knockbackPoints[knockbackPoints.length - 1]);
resend(player, "u+cid");
Expand All @@ -11775,7 +11775,7 @@ function update_instance(instance) {
} else {
console.log(`${player.name} NOT inside the polygon!`);
}
}, 1000);
}, 2000);
// if (distance(player, monster) < 480) {
// commence_attack(monster, player, "fireball");
// }
Expand Down

0 comments on commit 2729cec

Please sign in to comment.