Merge branch 'release/1.11.0' of ssh://git.mnml.gg:40022/~/mnml into release/1.11.0

This commit is contained in:
Mashy 2020-01-03 11:46:56 +10:00
commit 7a086c6189
6 changed files with 51 additions and 31 deletions

View File

@ -117,6 +117,10 @@ dl {
.logo {
margin: 2em 0;
}
.list {
margin-bottom: 0;
}
}
}

View File

@ -7,6 +7,12 @@
font-size: 8pt;
padding: 0;
&.front-page {
main {
padding: 0 0.5em;
}
}
.instance {
grid-template-areas:
"vbox vbox"
@ -273,6 +279,9 @@
}
.info-combiner {
max-height: 7em;
overflow-y: scroll;
.info {
display: none;
}

View File

@ -75,9 +75,9 @@ function Play(args) {
<hr />
{list()}
<hr />
{news}
<hr />
<Welcome />
<hr />
{news}
</main>
);
}

View File

@ -75,38 +75,19 @@ impl Effect {
match self {
Effect::Banish => true,
// delete sustain immunitiy???
/*Effect::Sustain => [
Skill::Stun,
Skill::Silence,
Skill::SilencePlus,
Skill::SilencePlusPlus,
Skill::Ruin,
Skill::RuinPlus,
Skill::RuinPlusPlus,
Skill::Restrict,
Skill::RestrictPlus,
Skill::RestrictPlusPlus
].contains(&skill),*/
// these provide immunity for the ticks
// the base skills will still resolve
// but they have early return checks
// to ensure the effect is reapplied but damage is not
Effect::Siphoned => [
Skill::Siphon,
Skill::SiphonPlus,
Skill::SiphonPlusPlus,
Skill::SiphonTick,
].contains(&skill),
Effect::Decayed => [
Skill::Decay,
Skill::DecayPlus,
Skill::DecayPlusPlus,
Skill::DecayTick,
].contains(&skill),
Effect::Triaged => [
Skill::Triage,
Skill::TriagePlus,
Skill::TriagePlusPlus,
Skill::TriageTick,
].contains(&skill),

View File

@ -388,6 +388,11 @@ impl Game {
let mut sorted = self.stack.clone();
sorted.iter_mut()
.for_each(|s| {
// we do not modify the speed of ticks
// as they are considered to be pinned to the speed
// that they were initially cast
if !s.skill.is_tick() {
let caster = self.construct_by_id(s.source).unwrap();
let speed = caster.skill_speed(s.skill);
@ -452,7 +457,15 @@ impl Game {
self.skill_phase_start(r_animation_ms)
}
fn modify_cast(&self, cast: Cast) -> Vec<Cast> {
fn modify_cast(&self, mut cast: Cast) -> Vec<Cast> {
// reassign the speeds based on the caster
// for test purposes
if !cast.skill.is_tick() {
let speed = self.construct(cast.source).skill_speed(cast.skill);
cast.speed = speed;
}
let target_player = self.players.iter()
.find(|t| t.constructs.iter().any(|c| c.id == cast.target))
.unwrap();
@ -499,11 +512,11 @@ impl Game {
}
let casts = self.modify_cast(cast);
let castable = casts.clone()
.into_iter()
let castable = casts
.iter()
.any(|c| !self.construct(c.target).is_ko() && !self.construct(c.target).immune(c.skill).is_some());
if castable {
self.action(cast, Action::Cast);
if cast.skill.aoe() {
@ -639,11 +652,14 @@ impl Game {
Value::TickDamage { construct, effect } =>
self.construct(construct).stat(Stat::TickDamage(effect)),
// Skills { construct: Uuid, colour: Colour },
}
}
pub fn affected(&self, construct: Uuid, effect: Effect) -> bool {
self.construct(construct).affected(effect)
}
fn cast(&mut self, cast: Cast) -> Event {
Event::Cast { construct: cast.source, player: cast.player, target: cast.target, skill: cast.skill, direction: self.direction(cast) }
}
@ -840,6 +856,7 @@ pub enum Value {
Removals { construct: Uuid },
DamageReceived { construct: Uuid, colour: Colour },
TickDamage { construct: Uuid, effect: Effect },
// Affected { construct: Uuid, effect: Effect }, // not an int :(
}
#[derive(Debug,Clone,PartialEq)]

View File

@ -989,6 +989,10 @@ fn siphon(cast: Cast, game: &mut Game, values: Siphon) {
}
);
// should only reapply the dot if they have already been hit by the dmg
// from either this or the tick
if game.affected(cast.target, Effect::Siphoned) { return; }
game.action(cast,
Action::Damage {
construct: cast.target,
@ -1580,6 +1584,8 @@ fn decay(cast: Cast, game: &mut Game, values: Decay) {
}
);
if game.affected(cast.target, Effect::Decayed) { return; }
game.action(cast,
Action::Effect {
construct: cast.target,
@ -2194,6 +2200,9 @@ fn triage(cast: Cast, game: &mut Game, values: Triage) {
Some(EffectMeta::CastTick { source: cast.source, target: cast.target, skill: Skill::TriageTick, speed: cast.speed, amount }) },
}
);
if game.affected(cast.target, Effect::Triaged) { return; }
game.action(cast,
Action::Heal {
construct: cast.target,