rename ability to skill
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user