warning and better pve targeting

This commit is contained in:
ntr 2018-12-04 00:20:58 +11:00
parent 63ec7a27ad
commit ad381d58f6
3 changed files with 9 additions and 2 deletions

View File

@ -203,7 +203,7 @@ function createSocket(events) {
ws.addEventListener('close', (event) => {
console.error('WebSocket closed', event);
toast.warn({
toast.warning({
message: 'disconnected',
position: 'topRight',
});

View File

@ -10,6 +10,8 @@
* Global rolls
* skills
* check cryp status when resolving skills
* ko / stun / silence etc prevent effect
* handle setting account better maybe?
* calculate
* hp increase/decrease

View File

@ -299,12 +299,17 @@ impl Game {
{
let mob_team_id = Uuid::nil();
let mobs = self.team_by_id(mob_team_id).clone();
let target_id = mobs.cryps.iter().find(|c| !c.is_ko()).map(|c| c.id).unwrap();
// TODO attack multiple players based on some criteria
for incoming_skill_id in self.stack.clone().iter()
.filter(|s| s.target_cryp_id.is_none() && s.target_team_id == mob_team_id)
.map(|s| s.id) {
let target_id = match mobs.cryps.iter().find(|c| {
self.cryp_targetable(mob_team_id, c.id).is_ok()})
{
Some(c) => c.id,
None => panic!("could not find a targetable pve cryp"),
};
self.add_target(mob_team_id, target_id, incoming_skill_id).unwrap();
}
}