2023-03-22 21:26:13 +05:30
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This code is based on the CRAB engine
|
|
|
|
*
|
|
|
|
* Copyright (c) Arvind Raja Yadav
|
|
|
|
*
|
|
|
|
* Licensed under MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-05-25 12:53:38 +05:30
|
|
|
#include "crab/crab.h"
|
2023-08-07 21:54:56 +05:30
|
|
|
#include "crab/loaders.h"
|
2023-03-29 21:46:33 +05:30
|
|
|
#include "crab/input/fightinput.h"
|
2023-03-21 17:19:09 +05:30
|
|
|
|
2023-03-29 19:09:23 +05:30
|
|
|
namespace Crab {
|
|
|
|
|
2023-03-21 17:19:09 +05:30
|
|
|
using namespace pyrodactyl::input;
|
|
|
|
|
2023-07-10 11:49:00 +05:30
|
|
|
void FightInput::load(rapidxml::xml_node<char> *node) {
|
2023-07-13 09:35:48 +05:30
|
|
|
loadEnum(_type, "type", node);
|
|
|
|
loadNum(_state, "state", node);
|
2023-03-21 17:19:09 +05:30
|
|
|
}
|
|
|
|
|
2023-07-13 09:35:48 +05:30
|
|
|
FightAnimationType FightInput::handleEvents(const Common::Event &event) {
|
2023-07-13 11:58:02 +05:30
|
|
|
if (g_engine->_inputManager->state(IG_ATTACK))
|
2023-04-03 19:31:43 +05:30
|
|
|
return FA_ATTACK;
|
2023-07-13 11:58:02 +05:30
|
|
|
else if (g_engine->_inputManager->state(IG_BLOCK))
|
2023-04-03 19:31:43 +05:30
|
|
|
return FA_BLOCK;
|
|
|
|
|
|
|
|
return FA_IDLE;
|
|
|
|
}
|
|
|
|
|
2023-03-29 19:09:23 +05:30
|
|
|
} // End of namespace Crab
|