remove targetting arrows and skills from combat, reduce construct hp

This commit is contained in:
Mashy 2020-08-24 12:32:27 +10:00
parent 9dfd3a733a
commit 4fac208d8b
3 changed files with 2 additions and 80 deletions

View File

@ -95,7 +95,6 @@ class GameConstruct extends preact.Component {
style={ activeSkill ? { cursor: 'pointer' } : {}}
class={`game-construct ${ko} ${koEvent()} ${unfocus} ${highlight}`}>
<div class="left">
{crypSkills}
<ConstructEffectBox construct={construct} />
</div>
<div class="right">

View File

@ -40,25 +40,13 @@ class TargetSvg extends Component {
render(props, state) {
const {
// Changing State Variables
account,
animating,
game,
gameEffectInfo,
} = props;
const { width, height } = state;
if (!game) return false; // game will be null when battle ends
if (game.phase === 'Finished') return false; // Clear everything if its over (in case of abandon)
// First round of a game
if (!game.resolutions.length && game.stack.length === 0) {
return (
<div class="resolving-skill">
<h2><b>Select a skill</b> from each construct, <b>click a target</b> for that skill and then click <b>READY</b>.</h2>
</div>
);
}
// Whenever someones looking at effects throw it up here
if (gameEffectInfo) {
const regEx = /(RedPower|BluePower|GreenPower|RedLife|BlueLife|GreenLife|SpeedStat)/;
@ -72,72 +60,7 @@ class TargetSvg extends Component {
</div>
);
}
// resolutions happening
// just put skill name up
if (animating) return false;
const playerTeam = game.players.find(t => t.id === account.id);
const otherTeam = game.players.find(t => t.id !== account.id);
const playerTeamIds = playerTeam.constructs.map(c => c.id);
const outgoing = game.stack.filter(stack => stack.player === account.id);
function getPath(cast) {
const source = playerTeam.constructs.findIndex(c => c.id === cast.source);
const defensive = playerTeamIds.includes(cast.target);
const target = defensive
? playerTeam.constructs.findIndex(c => c.id === cast.target)
: otherTeam.constructs.findIndex(c => c.id === cast.target);
const skillNumber = window.innerWidth <= 800 // mobile styling trigger
? playerTeam.constructs[source].skills.findIndex(s => s.skill === cast.skill)
: 0;
const sourceY = height;
const sourceX = (source * width / 3) + width / 18 + skillNumber * (width / 9);
const targetX = (target * width / 3) + width / 6
+ (defensive ? width / 64 : 0)
+ (source * width / 18);
const targetY = defensive ? height : 0;
const bendStart = height * (0.7 - 0.1 * source);
const bendEnd = height * 0.20;
if (defensive) {
const path = `
M${sourceX},${sourceY}
L${sourceX},${bendStart}
L${targetX},${bendStart}
L${targetX},${targetY}
L${targetX - (width * 0.005)},${height * 0.875}
M${targetX},${targetY}
L${targetX + (width * 0.005)},${height * 0.875}
`;
return <path d={path} />;
}
const path = `
M${sourceX},${sourceY}
L${sourceX},${bendStart}
L${targetX},${bendEnd}
L${targetX},${targetY}
L${targetX - (width * 0.005)},${height * 0.125}
M${targetX},${targetY}
L${targetX + (width * 0.005)},${height * 0.125}
`;
return <path d={path} />;
}
return (
<svg id="targeting"
viewBox={`0 0 ${width} ${height}`}
preserveAspectRatio="none"
class="targeting-arrows">
{outgoing.map(getPath)}
</svg>
);
return false;
}
componentDidMount() {

View File

@ -233,7 +233,7 @@ impl Construct {
blue_power: ConstructStat { base: 320, value: 320, max: 320, stat: Stat::BluePower },
blue_life: ConstructStat { base: 125, value: 125, max: 125, stat: Stat::BlueLife },
green_power: ConstructStat { base: 320, value: 320, max: 320, stat: Stat::GreenPower },
green_life: ConstructStat { base: 800, value: 800, max: 800, stat: Stat::GreenLife },
green_life: ConstructStat { base: 400, value: 400, max: 400, stat: Stat::GreenLife },
speed: ConstructStat { base: 100, value: 100, max: 100, stat: Stat::Speed },
// evasion: ConstructStat { base: 0, value: 0, max: 0, stat: Stat::Evasion },
skills: vec![],