Merge branch 'master' into battleui
This commit is contained in:
+5
-5
@@ -616,11 +616,11 @@ module.exports = {
|
||||
avoidQuotes: true,
|
||||
}],
|
||||
|
||||
// suggest using arrow functions as callbacks
|
||||
'prefer-arrow-callback': ['error', {
|
||||
allowNamedFunctions: false,
|
||||
allowUnboundThis: true,
|
||||
}],
|
||||
// // suggest using arrow functions as callbacks
|
||||
// 'prefer-arrow-callback': ['error', {
|
||||
// allowNamedFunctions: false,
|
||||
// allowUnboundThis: true,
|
||||
// }],
|
||||
|
||||
// suggest using of const declaration for variables that are never modified after declared
|
||||
'prefer-const': ['error', {
|
||||
|
||||
@@ -10,11 +10,16 @@ const addState = connect(
|
||||
|
||||
function selectSkillTarget(targetTeamId) {
|
||||
if (activeSkill) {
|
||||
return ws.sendGameSkill(game.id, activeSkill.crypId, targetTeamId, activeSkill.skill);
|
||||
return ws.sendGameSkill(game.id, activeSkill.crypId, targetTeamId, activeSkill.skill.skill);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// intercept self casting skills
|
||||
if (activeSkill && activeSkill.skill.self_targeting) {
|
||||
ws.sendGameSkill(game.id, activeSkill.crypId, null, activeSkill.skill.skill);
|
||||
}
|
||||
|
||||
function selectIncomingTarget(crypId) {
|
||||
if (activeIncoming) {
|
||||
return ws.sendGameTarget(game.id, crypId, activeIncoming);
|
||||
@@ -27,11 +32,11 @@ const addState = connect(
|
||||
|
||||
function receiveDispatch(dispatch) {
|
||||
function setActiveSkill(crypId, skill) {
|
||||
dispatch(actions.setActiveSkill(crypId, skill))
|
||||
dispatch(actions.setActiveSkill(crypId, skill));
|
||||
}
|
||||
|
||||
function setActiveIncoming(skillId) {
|
||||
dispatch(actions.setActiveIncoming(skillId))
|
||||
dispatch(actions.setActiveIncoming(skillId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ function GamePanel(props) {
|
||||
|
||||
const playerTeam = game.teams.find(t => t.id === account.id);
|
||||
|
||||
const incoming = playerTeam.incoming.map((inc) => {
|
||||
const incoming = game.stack.filter(s => s.target_team_id === playerTeam.id).map((inc) => {
|
||||
key.unbind('1');
|
||||
key('1', () => setActiveIncoming(inc.id));
|
||||
return (
|
||||
@@ -41,14 +41,14 @@ function GamePanel(props) {
|
||||
const skills = cryp.skills.map((skill, i) => {
|
||||
const hotkey = SKILL_HOT_KEYS[i];
|
||||
key.unbind(hotkey);
|
||||
key(hotkey, () => setActiveSkill(cryp.id, skill.skill));
|
||||
key(hotkey, () => setActiveSkill(cryp.id, skill));
|
||||
|
||||
return (
|
||||
<button
|
||||
key={i}
|
||||
className="button is-dark"
|
||||
type="submit"
|
||||
onClick={() => setActiveSkill(cryp.id, skill.skill)}
|
||||
onClick={() => setActiveSkill(cryp.id, skill)}
|
||||
>
|
||||
({hotkey}) {skill.skill} {skill.cd && `(${skill.cd}T)`}
|
||||
</button>
|
||||
@@ -59,7 +59,6 @@ function GamePanel(props) {
|
||||
<div key={i}>{status} for {status.turns}T</div>
|
||||
));
|
||||
|
||||
if (activeIncoming) console.log('should be a pointer');
|
||||
return (
|
||||
<div
|
||||
key={cryp.id}
|
||||
|
||||
@@ -99,6 +99,7 @@ function createSocket(store) {
|
||||
// Outgoing
|
||||
// -------------
|
||||
function send(msg) {
|
||||
console.log('outgoing msg', msg);
|
||||
msg.token = account && account.token;
|
||||
ws.send(cbor.encode(msg));
|
||||
}
|
||||
@@ -142,7 +143,7 @@ function createSocket(store) {
|
||||
}
|
||||
|
||||
function sendGameTarget(gameId, crypId, skillId) {
|
||||
send({ method: 'game_target', params: { game_id: gameId, cryp_id: crypId, cast_id: skillId } });
|
||||
send({ method: 'game_target', params: { game_id: gameId, cryp_id: crypId, skill_id: skillId } });
|
||||
store.dispatch(actions.setActiveIncoming(null));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user