Merge branch 'master' of ssh://cryps.gg:40022/~/cryps

This commit is contained in:
Mashy 2019-05-21 16:13:19 +10:00
commit a052bbc4eb
10 changed files with 113 additions and 61 deletions

View File

@ -8,6 +8,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Changed ### Changed
## [In Progress] ## [In Progress]
### Added
Added `Buff` as a skill
Increases Speed and RedDamage by 25%
Duration 2T
No CD
*BALANCE* *BALANCE*
- purify - purify
- 1 effect from all cryps at level 2 - 1 effect from all cryps at level 2

View File

@ -205,7 +205,6 @@
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
text-align: center;
} }
CRYP DAMAGE CRYP DAMAGE

View File

@ -133,7 +133,7 @@
} }
.vbox-table td { .vbox-table td {
transition-property: color background border; transition-property: color, background, border;
transition-duration: 0.5s; transition-duration: 0.5s;
transition-delay: 0; transition-delay: 0;
transition-timing-function: ease; transition-timing-function: ease;
@ -162,11 +162,11 @@
padding: 0.5em; padding: 0.5em;
border: 2px solid #222; border: 2px solid #222;
border-left-width: 0; border-left-width: 0;
transition-property: all; /* transition-property: all;
transition-duration: 0.5s; transition-duration: 0.5s;
transition-delay: 0; transition-delay: 0;
transition-timing-function: ease; transition-timing-function: ease;
} */}
.instance-cryp:first-child { .instance-cryp:first-child {
margin-left: 0; margin-left: 0;

View File

@ -142,7 +142,7 @@ button, input {
font-size: 100%; font-size: 100%;
/*the transitions */ /*the transitions */
transition-property: all; transition-property: color;
transition-duration: 0.5s; transition-duration: 0.5s;
transition-delay: 0; transition-delay: 0;
transition-timing-function: ease; transition-timing-function: ease;
@ -473,7 +473,7 @@ main .top {
} }
.ready:hover { .ready:hover {
transition-property: all; transition-property: color, border-color;
transition-duration: 0.5s; transition-duration: 0.5s;
transition-timing-function: ease; transition-timing-function: ease;
color: forestgreen; color: forestgreen;

View File

@ -1,6 +1,7 @@
@media (max-height: 800px), (max-width: 1000px) { @media (max-height: 800px), (max-width: 1000px) {
#cryps { #cryps {
font-size: 12pt; font-size: 12pt;
padding: 0;
grid-template-columns: min-content 1fr; grid-template-columns: min-content 1fr;
grid-template-rows: min-content 1fr; grid-template-rows: min-content 1fr;
grid-template-areas: grid-template-areas:
@ -28,13 +29,13 @@
transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out;
} }
main { /* main {
-webkit-transition: all 0.5s ease-in-out; -webkit-transition: all 0.5s ease-in-out;
-moz-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out;
-o-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out;
transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out;
} }
*/
#toggle-nav { display: none; } #toggle-nav { display: none; }
#toggle-nav-label { #toggle-nav-label {

View File

@ -47,7 +47,7 @@ function Main(props) {
if (nav === 'list') return <List />; if (nav === 'list') return <List />;
return ( return (
<Team /> <main></main>
); );
} }

View File

@ -13,9 +13,12 @@ const addState = connect(
instances, instances,
team, team,
cryps, cryps,
game,
} = state; } = state;
function sendInstanceState(instance) { function sendInstanceState(instance) {
ws.clearGameStateTimeout();
ws.clearInstanceStateTimeout();
return ws.sendInstanceState(instance.id); return ws.sendInstanceState(instance.id);
} }
@ -24,6 +27,7 @@ const addState = connect(
instances, instances,
team, team,
cryps, cryps,
game,
sendInstanceState, sendInstanceState,
}; };
}, },
@ -57,14 +61,21 @@ function Nav(args) {
team, team,
cryps, cryps,
instances, instances,
game,
navTo, navTo,
setTestGame, setTestGame,
setTestInstance, setTestInstance,
} = args; } = args;
function joinInstance(i) {
if (game) navTo(null);
sendInstanceState(i);
return true;
}
const joined = instances.map(i => ( const joined = instances.map(i => (
<button key={i.id} onClick={() => sendInstanceState(i)} >{i.name}</button> <button key={i.id} onClick={() => joinInstance(i)} >{i.name}</button>
)); ));
const teamElements = team.map((c, i) => { const teamElements = team.map((c, i) => {

View File

@ -101,6 +101,7 @@ function registerEvents(store) {
function setAccount(account) { function setAccount(account) {
store.dispatch(actions.setAccount(account)); store.dispatch(actions.setAccount(account));
store.dispatch(actions.setNav('team'));
} }
function clearCombiner() { function clearCombiner() {

View File

@ -1,4 +1,4 @@
use skill::{Skill}; use skill::{Skill, Effect};
use spec::{Spec}; use spec::{Spec};
use cryp::{Colours}; use cryp::{Colours};
@ -177,6 +177,7 @@ impl Item {
Item::Banish => Some(Skill::Banish), Item::Banish => Some(Skill::Banish),
Item::Blast => Some(Skill::Blast), Item::Blast => Some(Skill::Blast),
Item::Block => Some(Skill::Block), Item::Block => Some(Skill::Block),
Item::Buff => Some(Skill::Buff),
Item::Chaos => Some(Skill::Chaos), Item::Chaos => Some(Skill::Chaos),
Item::Curse => Some(Skill::Curse), Item::Curse => Some(Skill::Curse),
Item::Debuff => Some(Skill::Debuff), Item::Debuff => Some(Skill::Debuff),
@ -251,46 +252,59 @@ impl Item {
Item::Red => format!("Combine with skills and specs to create upgraded items. \n Speed and chaos."), Item::Red => format!("Combine with skills and specs to create upgraded items. \n Speed and chaos."),
// base skills // base skills
Item::Attack => format!("Deal red damage based on {:?}% red power", self.into_skill().unwrap().multiplier()), Item::Attack => format!("Deal red damage based on {:?}% red power",
Item::Block => format!("description"), self.into_skill().unwrap().multiplier()),
Item::Stun => format!("description"), Item::Block => format!("Reduce incoming red damage by {:?}%",
Item::Buff => format!("description"), 100 - Effect::Block.apply(100, None)),
Item::Debuff => format!("description"), Item::Stun => format!("Stun target cryp for {:?}T",
self.into_skill().unwrap().duration()),
Item::Buff => format!("Increase target cryp red damage and speed by {:?}%",
Effect::Buff.apply(100, None) - 100),
Item::Debuff => format!("Slow target cryp"),
// specs // specs
// Base // Base
Item::Damage => format!("description"), Item::Damage => format!("Base ITEM for increased DAMAGE. DAMAGE determines the power of your SKILLS."),
Item::Life => format!("description"), Item::Life => format!("Base ITEM for increased LIFE.
Item::Speed => format!("description"), When your CRYP reaches 0 GreenLife it becomes KO and cannot cast SKILLS."),
Item::Speed => format!("Base ITEM for increased SPEED.
SPEED determines the order in which skills resolve."),
// Lifes Upgrades // Lifes Upgrades
Item::GreenLifeI => format!("description"), Item::GreenLifeI => format!("Increases CRYP GreenLife.
Item::RedLifeI => format!("description"), When your CRYP reaches 0 GreenLife it becomes KO and cannot cast SKILLS."),
Item::BlueLifeI => format!("description"), Item::RedLifeI => format!("Increases CRYP RedLife.
Item::GRLI => format!("description"), Red damage dealt to your cryp reduces RedLife before GreenLife."),
Item::GBLI => format!("description"), Item::BlueLifeI => format!("Increases CRYP BlueLife.
Item::RBLI => format!("description"), Blue damage dealt to your cryp reduces BlueLife before GreenLife."),
Item::GRLI => format!("Increases CRYP GreenLife + RedLife"),
Item::GBLI => format!("Increases CRYP GreenLife + BlueLife"),
Item::RBLI => format!("Increases CRYP RedLife + BlueLife"),
// Damage Upgrades // Damage Upgrades
Item::RedDamageI => format!("description"), Item::RedDamageI => format!("Increases CRYP RedDamage."),
Item::BlueDamageI => format!("description"), Item::BlueDamageI => format!("Increases CRYP BlueDamage."),
Item::GreenDamageI => format!("description"), Item::GreenDamageI => format!("Increases CRYP GreenDamage."),
Item::GRDI => format!("description"), Item::GRDI => format!("Increases CRYP GreenDamage + RedDamage."),
Item::GBDI => format!("description"), Item::GBDI => format!("Increases CRYP GreenDamage + BlueDamage."),
Item::RBDI => format!("description"), Item::RBDI => format!("Increases CRYP RedDamage + BlueDamage."),
// Speed Upgrades // Speed Upgrades
Item::RedSpeedI => format!("description"), Item::RedSpeedI => format!("Increases CRYP SPEED and provides COLOUR BONUSES"),
Item::BlueSpeedI => format!("description"), Item::BlueSpeedI => format!("Increases CRYP SPEED and provides COLOUR BONUSES"),
Item::GreenSpeedI => format!("description"), Item::GreenSpeedI => format!("Increases CRYP SPEED and provides COLOUR BONUSES"),
Item::GRSpeedI => format!("description"), Item::GRSpeedI => format!("Increases CRYP SPEED and provides COLOUR BONUSES"),
Item::GBSpeedI => format!("description"), Item::GBSpeedI => format!("Increases CRYP SPEED and provides COLOUR BONUSES"),
Item::RBSpeedI => format!("description"), Item::RBSpeedI => format!("Increases CRYP SPEED and provides COLOUR BONUSES"),
// Skills <- need to move effect mulltipliers into skills // Skills <- need to move effect mulltipliers into skills
Item::Amplify => format!("Increase red and blue power by 50%. Lasts {:?}T", self.into_skill().unwrap().duration()), Item::Amplify => format!("Increase red and blue power by {:?}%. Lasts {:?}T",
Effect::Amplify.apply(100, None) - 100,
self.into_skill().unwrap().duration()),
Item::Banish => format!("Banish target for {:?}T", self.into_skill().unwrap().duration()), Item::Banish => format!("Banish target for {:?}T.
Banished cryps are immune to all skills and effects."
, self.into_skill().unwrap().duration()),
Item::Blast => format!("Deals blue damage {:?}% blue power.", self.into_skill().unwrap().multiplier()), Item::Blast => format!("Deals blue damage {:?}% blue power.", self.into_skill().unwrap().multiplier()),
@ -330,20 +344,22 @@ impl Item {
Item::Heal => format!("Heals for {:?}% green power.", self.into_skill().unwrap().multiplier()), Item::Heal => format!("Heals for {:?}% green power.", self.into_skill().unwrap().multiplier()),
Item::Hex => format!("Applies Hex for {:?}T", self.into_skill().unwrap().duration()), Item::Hex => format!("Blue based skill that applies Hex for {:?}T.
Hexed targets cannot cast any skills.", self.into_skill().unwrap().duration()),
Item::Impurity => format!( Item::Impurity => format!(
"{} {:?}{}. Lasts {:?}T", "{} {:?}{}. Lasts {:?}T",
"Impurity increases Green Power by 50%, Blue based Attack skills will blast again dealing", "Impurity increases Green Power by 50%, Blue based Attack skills will blast again dealing",
Skill::HasteStrike.multiplier(), Skill::ImpureBlast.multiplier(),
"% Green Power as Blue Damage", "% Green Power as Blue Damage",
self.into_skill().unwrap().duration()), self.into_skill().unwrap().duration()),
Item::Invert => format!( Item::Invert => format!(
"Reverse healing into damage and damage into healing."), "Reverse healing into damage and damage into healing.
Any excess red or blue damage is converted into shield recharge."),
Item::Parry => format!("{} {:?}% red power and blocks red skills for {:?}T. {} {:?}% red power.", Item::Parry => format!("{} {:?}% red power and blocks red skills for {:?}T. {} {:?}% red power.",
"Self targetting skill. Recharges red life for", "Self targetting skill. Recharges RedLife for",
self.into_skill().unwrap().multiplier(), self.into_skill().unwrap().multiplier(),
self.into_skill().unwrap().duration(), self.into_skill().unwrap().duration(),
"If a red skill is parried the cryp will riposte the source dealing red damage", "If a red skill is parried the cryp will riposte the source dealing red damage",
@ -393,8 +409,8 @@ impl Item {
"Deals 35% more damage per red skill on target"), "Deals 35% more damage per red skill on target"),
Item::Strangle => format!( Item::Strangle => format!(
"{} While strangling deal red damage each turn {:?}% red power. Lasts {:?}T.", "Strangle the target disabling skills from both the caster and the target.
"Strangle the target disabling skills from both the caster and the target.", While strangling deal red damage each turn {:?}% red power. Lasts {:?}T.",
self.into_skill().unwrap().multiplier(), self.into_skill().unwrap().multiplier(),
self.into_skill().unwrap().duration()), self.into_skill().unwrap().duration()),
@ -413,7 +429,7 @@ impl Item {
self.into_skill().unwrap().multiplier(), self.into_skill().unwrap().multiplier(),
self.into_skill().unwrap().duration()), self.into_skill().unwrap().duration()),
Item::Taunt => format!("{} {:?}T. Recharges red life for {:?} red power.", Item::Taunt => format!("{} {:?}T. Recharges RedLife for {:?} red power.",
"Taunt redirects skills against the team to target, lasts", "Taunt redirects skills against the team to target, lasts",
self.into_skill().unwrap().duration(), self.into_skill().unwrap().duration(),
self.into_skill().unwrap().multiplier()), self.into_skill().unwrap().multiplier()),
@ -441,6 +457,7 @@ impl From<Skill> for Item {
Skill::Banish => Item::Banish, Skill::Banish => Item::Banish,
Skill::Blast => Item::Blast, Skill::Blast => Item::Blast,
Skill::Block => Item::Block, Skill::Block => Item::Block,
Skill::Buff => Item::Buff,
Skill::Chaos => Item::Chaos, Skill::Chaos => Item::Chaos,
Skill::Curse => Item::Curse, Skill::Curse => Item::Curse,
Skill::Clutch => Item::Clutch, Skill::Clutch => Item::Clutch,
@ -479,7 +496,7 @@ impl From<Skill> for Item {
Skill::TestBlock => Item::TestBlock, Skill::TestBlock => Item::TestBlock,
Skill::TestParry => Item::TestParry, Skill::TestParry => Item::TestParry,
Skill::TestSiphon => Item::TestSiphon, Skill::TestSiphon => Item::TestSiphon,
_ => panic!("{:?} not implemented as a item", skill), _ => panic!("{:?} not implemented with item conversion", skill),
} }
} }
} }

View File

@ -117,6 +117,7 @@ pub fn resolve(skill: Skill, source: &mut Cryp, target: &mut Cryp, mut resolutio
Skill::Banish => banish(source, target, resolutions, skill), // TODO prevent all actions Skill::Banish => banish(source, target, resolutions, skill), // TODO prevent all actions
Skill::Blast => blast(source, target, resolutions, skill), Skill::Blast => blast(source, target, resolutions, skill),
Skill::Block => block(source, target, resolutions, skill), Skill::Block => block(source, target, resolutions, skill),
Skill::Buff => buff(source, target, resolutions, skill),
Skill::Chaos => chaos(source, target, resolutions, skill), Skill::Chaos => chaos(source, target, resolutions, skill),
Skill::Clutch => clutch(source, target, resolutions, skill), Skill::Clutch => clutch(source, target, resolutions, skill),
Skill::Corrupt => corrupt(source, target, resolutions, skill), Skill::Corrupt => corrupt(source, target, resolutions, skill),
@ -317,6 +318,7 @@ pub type Cooldown = Option<u8>;
pub enum Effect { pub enum Effect {
// physical // physical
Stun, Stun,
Buff,
Parry, Parry,
Block, Block,
Bleed, Bleed,
@ -427,6 +429,7 @@ impl Effect {
match self { match self {
Effect::Vulnerable => vec![Stat::RedDamageTaken], Effect::Vulnerable => vec![Stat::RedDamageTaken],
Effect::Block => vec![Stat::RedDamageTaken], Effect::Block => vec![Stat::RedDamageTaken],
Effect::Buff => vec![Stat::RedDamage, Stat::Speed],
Effect::Hatred => vec![Stat::RedDamage, Stat::BlueDamage], Effect::Hatred => vec![Stat::RedDamage, Stat::BlueDamage],
@ -449,6 +452,7 @@ impl Effect {
match self { match self {
Effect::Vulnerable => value.pct(150), Effect::Vulnerable => value.pct(150),
Effect::Block => value.pct(50), Effect::Block => value.pct(50),
Effect::Buff => value.pct(125),
Effect::Amplify => value.pct(150), Effect::Amplify => value.pct(150),
Effect::Curse => value.pct(150), Effect::Curse => value.pct(150),
@ -478,6 +482,7 @@ impl Effect {
// physical // physical
Effect::Stun => Category::Debuff, Effect::Stun => Category::Debuff,
Effect::Block => Category::Buff, Effect::Block => Category::Buff,
Effect::Buff => Category::Buff,
Effect::Parry => Category::Buff, Effect::Parry => Category::Buff,
Effect::Bleed => Category::Debuff, Effect::Bleed => Category::Debuff,
Effect::Leech => Category::Debuff, Effect::Leech => Category::Debuff,
@ -559,6 +564,7 @@ pub enum Category {
pub enum Skill { pub enum Skill {
Attack, Attack,
Debuff, Debuff,
Buff,
Block, // reduce damage Block, // reduce damage
Stun, Stun,
@ -691,6 +697,7 @@ impl Skill {
pub fn duration(&self) -> u8 { pub fn duration(&self) -> u8 {
match self { match self {
Skill::Block => 1, Skill::Block => 1,
Skill::Buff => 2,
Skill::Parry => 2, Skill::Parry => 2,
Skill::Clutch => 1, Skill::Clutch => 1,
Skill::Debuff => 3, Skill::Debuff => 3,
@ -755,6 +762,7 @@ impl Skill {
match self { match self {
Skill::Attack => None, Skill::Attack => None,
Skill::Debuff => Some(1), Skill::Debuff => Some(1),
Skill::Buff => None,
Skill::Strike => None, Skill::Strike => None,
Skill::StrikeII => None, Skill::StrikeII => None,
Skill::StrikeIII => None, Skill::StrikeIII => None,
@ -835,6 +843,7 @@ impl Skill {
Skill::Slay => Category::Red, Skill::Slay => Category::Red,
Skill::Taunt => Category::Red, Skill::Taunt => Category::Red,
Skill::HasteStrike => Category::Red, Skill::HasteStrike => Category::Red,
Skill::Buff => Category::Red,
Skill::Heal => Category::Green, Skill::Heal => Category::Green,
Skill::Triage => Category::Green, // hot Skill::Triage => Category::Green, // hot
@ -1078,6 +1087,12 @@ fn block(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill:
return results; return results;
} }
fn buff(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
let fx = CrypEffect::new(Effect::Buff, skill.duration());
results.push(Resolution::new(source, target).event(target.add_effect(skill, fx)));
return results;
}
fn parry(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions { fn parry(source: &mut Cryp, target: &mut Cryp, mut results: Resolutions, skill: Skill) -> Resolutions {
let red_amount = source.red_damage().pct(skill.multiplier()); let red_amount = source.red_damage().pct(skill.multiplier());
results.push(Resolution::new(source, target).event(target.recharge(skill, red_amount, 0))); results.push(Resolution::new(source, target).event(target.recharge(skill, red_amount, 0)));