1 /* 2 * This file is part of EasyRPG Player. 3 * 4 * EasyRPG Player is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * EasyRPG Player is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef EP_ATTRIBUTE_H 19 #define EP_ATTRIBUTE_H 20 21 #include <lcf/rpg/fwd.h> 22 #include <lcf/dbbitarray.h> 23 #include "span.h" 24 #include "game_battler.h" 25 26 class Game_Battler; 27 class Game_Actor; 28 29 /** Namespace of functions dealing with attribute modifiers */ 30 namespace Attribute { 31 32 /** 33 * Gets the attribute damage multiplier/protection (A-E). 34 * 35 * @param attribute_id Attribute to test 36 * @param rate Attribute rate to get 37 * @return Attribute rate 38 */ 39 int GetAttributeRateModifier(int attribute_id, int rate); 40 41 /** 42 * Gets the attribute damage multiplier/protection (A-E). 43 * 44 * @param attr Attribute to test 45 * @param rate Attribute rate to get 46 * @return Attribute rate 47 */ 48 int GetAttributeRateModifier(const lcf::rpg::Attribute& attr, int rate); 49 50 /** 51 * Modifies the effect by weapon attributes against the target. 52 * 53 * @param effect Base effect to adjust 54 * @param source Source who is attacking target 55 * @param target Target to apply attributes against 56 * @param weapon The weapon to use, or kWeaponAll 57 * @return modified effect 58 */ 59 int ApplyAttributeNormalAttackMultiplier(int effect, const Game_Battler& source, const Game_Battler& target, Game_Battler::Weapon weapon); 60 61 /** 62 * Modifies the effect by weapon attributes against the target. 63 * 64 * @param effect Base effect to adjust 65 * @param target Target to apply attributes against 66 * @param skill Skill being used against target 67 * @return modified effect 68 */ 69 int ApplyAttributeSkillMultiplier(int effect, const Game_Battler& target, const lcf::rpg::Skill& skill); 70 71 /** 72 * Modifies the effect by weapon attributes against the target. 73 * 74 * @param effect Base effect to adjust 75 * @param attribute_sets A Span of attribute bitsets to check for attributes to apply against the target. 76 * @param target Target to apply attributes against 77 * @return modified effect 78 */ 79 int ApplyAttributeMultiplier(int effect, const Game_Battler& target, Span<const lcf::DBBitArray*> attribute_sets); 80 81 } // namespace Attribute 82 83 84 #endif 85