inventory wip
This commit is contained in:
parent
f24b5afd5c
commit
e45f28e4ea
@ -33,7 +33,6 @@
|
|||||||
* rename costs 1cr
|
* rename costs 1cr
|
||||||
* invader set
|
* invader set
|
||||||
|
|
||||||
* start with 3 constructs w/ random names
|
|
||||||
* new construct costs 5cr
|
* new construct costs 5cr
|
||||||
|
|
||||||
|
|
||||||
@ -56,10 +55,10 @@ do not allow vbox actions for finished instances
|
|||||||
|
|
||||||
*SERVER*
|
*SERVER*
|
||||||
|
|
||||||
|
* push events
|
||||||
|
|
||||||
## SOON
|
## SOON
|
||||||
|
|
||||||
* push events
|
|
||||||
* iconography
|
* iconography
|
||||||
* icons change with %
|
* icons change with %
|
||||||
* find new icons for colours / life
|
* find new icons for colours / life
|
||||||
@ -76,9 +75,6 @@ do not allow vbox actions for finished instances
|
|||||||
|
|
||||||
* mnml tv
|
* mnml tv
|
||||||
|
|
||||||
* flavour text
|
|
||||||
* chat wheel trash talk
|
|
||||||
* KO animations and trash talk
|
|
||||||
|
|
||||||
* the *real* authentication endpoint
|
* the *real* authentication endpoint
|
||||||
hit /auth with un/pw or token
|
hit /auth with un/pw or token
|
||||||
|
|||||||
@ -399,6 +399,7 @@ header {
|
|||||||
|
|
||||||
.menu-construct .controls {
|
.menu-construct .controls {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-construct .controls h2 {
|
.menu-construct .controls h2 {
|
||||||
@ -408,9 +409,8 @@ header {
|
|||||||
.menu-construct .controls button {
|
.menu-construct .controls button {
|
||||||
color: #444;
|
color: #444;
|
||||||
flex: 0;
|
flex: 0;
|
||||||
margin: 0;
|
margin: 0 1em 0 0;
|
||||||
border: none;
|
border: none;
|
||||||
padding: 0.25em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu-construct .controls button:hover, .menu-construct .controls button:active {
|
.menu-construct .controls button:hover, .menu-construct .controls button:active {
|
||||||
@ -454,6 +454,31 @@ header {
|
|||||||
opacity: 0
|
opacity: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.inventory {
|
||||||
|
display: flex;
|
||||||
|
flex-flow: row wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inventory h2 {
|
||||||
|
flex: 1 0 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inventory figure {
|
||||||
|
flex: 0 0 10%;
|
||||||
|
display: flex;
|
||||||
|
flex-flow: column;
|
||||||
|
margin: 0.5em 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* heading included */
|
||||||
|
.inventory figure:nth-child(3) {
|
||||||
|
margin-right: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.inventory figure div {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.menu-instances {
|
.menu-instances {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
export const setAccount = value => ({ type: 'SET_ACCOUNT', value });
|
export const setAccount = value => ({ type: 'SET_ACCOUNT', value });
|
||||||
export const setConstructs = value => ({ type: 'SET_CONSTRUCTS', value });
|
export const setConstructs = value => ({ type: 'SET_CONSTRUCTS', value });
|
||||||
export const setConstructDeleteId = value => ({ type: 'SET_CONSTRUCT_DELETE_ID', value });
|
export const setConstructEditId = value => ({ type: 'SET_CONSTRUCT_EDIT_ID', value });
|
||||||
export const setItemInfo = value => ({ type: 'SET_ITEM_INFO', value });
|
export const setItemInfo = value => ({ type: 'SET_ITEM_INFO', value });
|
||||||
export const setSkip = value => ({ type: 'SET_SKIP', value });
|
export const setSkip = value => ({ type: 'SET_SKIP', value });
|
||||||
export const setVboxHighlight = value => ({ type: 'SET_VBOX_HIGHLIGHT', value });
|
export const setVboxHighlight = value => ({ type: 'SET_VBOX_HIGHLIGHT', value });
|
||||||
|
|||||||
@ -37,6 +37,16 @@ const addState = connect(
|
|||||||
instanceList,
|
instanceList,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
function receiveDispatch(dispatch) {
|
||||||
|
function editConstruct(id) {
|
||||||
|
dispatch(actions.setConstructEditId(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
editConstruct,
|
||||||
|
};
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
function List(args) {
|
function List(args) {
|
||||||
@ -48,20 +58,16 @@ function List(args) {
|
|||||||
sendInstanceJoin,
|
sendInstanceJoin,
|
||||||
sendInstanceList,
|
sendInstanceList,
|
||||||
instanceList,
|
instanceList,
|
||||||
|
|
||||||
|
editConstruct,
|
||||||
} = args;
|
} = args;
|
||||||
|
|
||||||
function listElements() {
|
function listElements() {
|
||||||
if (!instanceList) return <div>...</div>;
|
if (!instanceList) return <div>...</div>;
|
||||||
|
|
||||||
const instancePanels = instanceList.map(instance => {
|
const instancePanels = instanceList.map(instance => {
|
||||||
const player = instance.players.find(p => p.id === account.id);
|
|
||||||
const scoreText = player
|
|
||||||
? `${player.wins} : ${player.losses}`
|
|
||||||
: '';
|
|
||||||
|
|
||||||
function instanceClick() {
|
function instanceClick() {
|
||||||
if (!player) return sendInstanceJoin(instance);
|
return sendInstanceJoin(instance);
|
||||||
return sendInstanceState(instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -69,21 +75,16 @@ function List(args) {
|
|||||||
class="right"
|
class="right"
|
||||||
onClick={instanceClick} >
|
onClick={instanceClick} >
|
||||||
<td>{instance.name}</td>
|
<td>{instance.name}</td>
|
||||||
<td>{instance.players.length} / {instance.max_players}</td>
|
|
||||||
<td>{scoreText}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="menu-instance-list" >
|
<div class="menu-instance-list" >
|
||||||
<hr />
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>instance name</th>
|
<th>opponent name</th>
|
||||||
<th>players</th>
|
|
||||||
<th>status</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -98,14 +99,22 @@ function List(args) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// <div class="controls">
|
||||||
|
// <button>⚙</button>
|
||||||
|
// </div>
|
||||||
|
|
||||||
const constructPanels = constructs
|
const constructPanels = constructs
|
||||||
.filter(c => team.includes(c.id))
|
.filter(c => team.includes(c.id))
|
||||||
.sort(idSort)
|
.sort(idSort)
|
||||||
.map(construct =>
|
.map(construct =>
|
||||||
<div
|
<div
|
||||||
key={construct.id}
|
key={construct.id}
|
||||||
|
// onClick={() => editConstruct(construct.id)}
|
||||||
class="menu-construct" >
|
class="menu-construct" >
|
||||||
<ConstructAvatar name={construct.name} id={construct.id} />
|
<ConstructAvatar
|
||||||
|
name={construct.name}
|
||||||
|
id={construct.id}
|
||||||
|
/>
|
||||||
<h2>{construct.name}</h2>
|
<h2>{construct.name}</h2>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@ -115,6 +124,22 @@ function List(args) {
|
|||||||
<div class="construct-list">
|
<div class="construct-list">
|
||||||
{constructPanels}
|
{constructPanels}
|
||||||
</div>
|
</div>
|
||||||
|
<hr />
|
||||||
|
<div class="inventory">
|
||||||
|
<h2>Inventory</h2>
|
||||||
|
<figure>
|
||||||
|
<figcaption>Reimage</figcaption>
|
||||||
|
<button>¤1</button>
|
||||||
|
</figure>
|
||||||
|
<figure>
|
||||||
|
<figcaption>Rename</figcaption>
|
||||||
|
<button>¤1</button>
|
||||||
|
</figure>
|
||||||
|
<figure>
|
||||||
|
<figcaption>Invader Architecture</figcaption>
|
||||||
|
<button>∞</button>
|
||||||
|
</figure>
|
||||||
|
</div>
|
||||||
{listElements()}
|
{listElements()}
|
||||||
</main>
|
</main>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -17,7 +17,7 @@ module.exports = {
|
|||||||
activeSkill: createReducer(null, 'SET_ACTIVE_SKILL'),
|
activeSkill: createReducer(null, 'SET_ACTIVE_SKILL'),
|
||||||
combiner: createReducer([null, null, null], 'SET_COMBINER'),
|
combiner: createReducer([null, null, null], 'SET_COMBINER'),
|
||||||
constructs: createReducer([], 'SET_CONSTRUCTS'),
|
constructs: createReducer([], 'SET_CONSTRUCTS'),
|
||||||
constructDeleteId: createReducer(null, 'SET_CONSTRUCT_DELETE_ID'),
|
constructEditId: createReducer(null, 'SET_CONSTRUCT_EDIT_ID'),
|
||||||
game: createReducer(null, 'SET_GAME'),
|
game: createReducer(null, 'SET_GAME'),
|
||||||
info: createReducer(null, 'SET_INFO'),
|
info: createReducer(null, 'SET_INFO'),
|
||||||
instance: createReducer(null, 'SET_INSTANCE'),
|
instance: createReducer(null, 'SET_INSTANCE'),
|
||||||
|
|||||||
@ -314,7 +314,7 @@ fn post_resolve(_skill: Skill, game: &mut Game, mut resolutions: Resolutions) ->
|
|||||||
.find(|e| e.effect == Effect::Absorb).unwrap().clone();
|
.find(|e| e.effect == Effect::Absorb).unwrap().clone();
|
||||||
match meta {
|
match meta {
|
||||||
Some(EffectMeta::Skill(s)) => {
|
Some(EffectMeta::Skill(s)) => {
|
||||||
resolutions = absorb(&mut target, &mut source, resolutions, skill, amount, s);
|
resolutions = absorption(&mut target, &mut source, resolutions, skill, amount, s);
|
||||||
},
|
},
|
||||||
_ => panic!("no absorb skill"),
|
_ => panic!("no absorb skill"),
|
||||||
};
|
};
|
||||||
@ -1520,12 +1520,12 @@ fn hex(source: &mut Construct, target: &mut Construct, mut results: Resolutions,
|
|||||||
return results;;
|
return results;;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn absorbtion(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
|
fn absorb(source: &mut Construct, target: &mut Construct, mut results: Resolutions, skill: Skill) -> Resolutions {
|
||||||
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect()[0])));
|
results.push(Resolution::new(source, target).event(target.add_effect(skill, skill.effect()[0])));
|
||||||
return results;;
|
return results;;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn absorb(source: &mut Construct, target: &mut Construct, mut results: Resolutions, reflect_skill: Skill, amount: u64, skill: Skill) -> Resolutions {
|
fn absorption(source: &mut Construct, target: &mut Construct, mut results: Resolutions, reflect_skill: Skill, amount: u64, skill: Skill) -> Resolutions {
|
||||||
let absorb = skill.effect()[0].set_meta(EffectMeta::AddedDamage(amount));
|
let absorb = skill.effect()[0].set_meta(EffectMeta::AddedDamage(amount));
|
||||||
results.push(Resolution::new(source, target)
|
results.push(Resolution::new(source, target)
|
||||||
.event(target.add_effect(reflect_skill, absorb))
|
.event(target.add_effect(reflect_skill, absorb))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user