rename ability to skill

This commit is contained in:
ntr
2018-10-21 12:05:07 +11:00
parent 3a4c9e4971
commit c3d20e888b
7 changed files with 85 additions and 83 deletions
+5 -5
View File
@@ -5,15 +5,15 @@ const Game = require('./game');
const addState = connect(
function receiveState(state) {
const { ws, game, account } = state;
function sendGameAbility(crypId, targetTeamId, ability) {
return ws.sendGameAbility(game.id, crypId, targetTeamId, ability);
function sendGameSkill(crypId, targetTeamId, skill) {
return ws.sendGameSkill(game.id, crypId, targetTeamId, skill);
}
function sendGameTarget(crypId, abilityId) {
return ws.sendGameTarget(game.id, crypId, abilityId);
function sendGameTarget(crypId, skillId) {
return ws.sendGameTarget(game.id, crypId, skillId);
}
return { game, account, sendGameAbility, sendGameTarget };
return { game, account, sendGameSkill, sendGameTarget };
}
);
+2 -2
View File
@@ -1,6 +1,6 @@
const preact = require('preact');
function GamePanel({ game, sendGameAbility, sendGameTarget, account }) {
function GamePanel({ game, sendGameSkill, sendGameTarget, account }) {
if (!game) return <div>...</div>;
const otherTeams = game.teams.filter(t => t.id !== account.id);
@@ -23,7 +23,7 @@ function GamePanel({ game, sendGameAbility, sendGameTarget, account }) {
<button
className="button is-dark is-fullwidth"
type="submit"
onClick={() => sendGameAbility(c.id, otherTeams[0].id, 'Attack')}>
onClick={() => sendGameSkill(c.id, otherTeams[0].id, 'Attack')}>
Attack
</button>
</div>
+5 -5
View File
@@ -113,12 +113,12 @@ function createSocket(store) {
send({ method: 'game_pve', params: { id } });
}
function sendGameAbility(gameId, crypId, targetTeamId, ability) {
send({ method: 'game_ability', params: { game_id: gameId, cryp_id: crypId, target_team_id: targetTeamId, ability } });
function sendGameSkill(gameId, crypId, targetTeamId, skill) {
send({ method: 'game_skill', params: { game_id: gameId, cryp_id: crypId, target_team_id: targetTeamId, skill } });
}
function sendGameTarget(gameId, crypId, abilityId) {
send({ method: 'game_target', params: { game_id: gameId, cryp_id: crypId, ability_id: abilityId } });
function sendGameTarget(gameId, crypId, skillId) {
send({ method: 'game_target', params: { game_id: gameId, cryp_id: crypId, skill_id: skillId } });
}
function sendItemUse(item, target) {
@@ -162,7 +162,7 @@ function createSocket(store) {
sendAccountLogin,
sendAccountRegister,
sendGamePve,
sendGameAbility,
sendGameSkill,
sendGameTarget,
sendCrypSpawn,
sendItemUse,