Closed earthiverse closed 6 months ago
I feel as though Curse could probably be changed to use the player's range. Only reason I would see for it to be at 200 would be if that was what it previously was.
Some more skills need fixing
for(const sN in G.skills) {
const gSkill = G.skills[sN]
if(gSkill.range) continue
if(gSkill.use_range) continue
if(!gSkill.target) continue
if(gSkill.global) continue
console.log(`${sN} might not have range`)
}
mentalburst might not have range curse might not have range charm might not have range tangle might not have range huntersmark might not have range supershot might not have range
Some skills has logic in the use_skills method if you do not supply a target 3shot for example uses this to find targets
var hostiles=get_nearby_hostiles({range:character.range-2,limit:3})
https://github.com/kaansoral/adventureland/blob/2950ab2c843bfdec4343265c4390a646098fea49/js/functions.js#L836-L850
The range check will never trigger in socket.on("skill")
if the skill does not have a range or the use_range property though
https://github.com/kaansoral/adventureland/blob/67d76dd2f36a96f9cf8e0c2434edd8fd7e2607dc/node/server.js#L8505
Should player range not just be the default, unless the skills is global / unlimited range? I think I prefer sensible defaults than having to be explicit when making new skills / abilities. If I want the range of a skill to adapt to the players range, I guess I could set use_range
to true but it is not obvious that it means player range if I don't specify a range
It's probably a good idea to fall back to character.range (or entity range if an entity is using the skill), will do.
Now falls back to using player range if unset.
Looking at old code, before refactoring:
mentalburst
used player.rangecurse
used min(200, attacker.range * 5 + 20)
charm
relied on B.max_vision
tangle
relied on B.max_vision
huntersmark
relied on B.max_vision
supershot
relied on distance(attacker, target) > 3 * attacker.range + 20
mentalburst and supershot just need use_range
added for clarity.
I changed curse
to 200, since that was its max value before.
We need to figure out a good range for charm
, tangle
, and huntersmark
.
Changes:
cburst
,3shot
,5shot
)use_range
to skills that hadtarget
set, but notrange
use_range
norrange
is setcurse
to 200 range (before refactoring it wasmin(200, attacker.range * 5 + 20)
)huntersmark
range to the same as supershot (3X + 20
) (was vision range before refactoring)tangle
to2X
range (was vision range before refactoring)