From 59f5cbfaeb62516ff103648fe512c24c0bfe94e6 Mon Sep 17 00:00:00 2001 From: Andrettin Date: Wed, 30 Mar 2016 20:41:28 +0200 Subject: [PATCH] The single-selected unit button popup now has information on its stats, and right-clicking the button leads to its encyclopedia entry --- src/game/game.cpp | 3 --- src/include/ui/popup.h | 18 ++++++++------ src/include/upgrade.h | 1 + src/stratagus/item.cpp | 4 ++-- src/stratagus/player.cpp | 4 ++-- src/tolua/player.pkg | 1 + src/ui/botpanel.cpp | 51 ++++++++++++++++++++++++++++++++-------- src/ui/mainscr.cpp | 23 +++++++++++++++--- src/ui/mouse.cpp | 41 ++++++++++++++++++++++++++++++-- src/ui/popup.cpp | 16 ++++++++++++- src/unit/unit.cpp | 4 ++++ src/unit/upgrade.cpp | 7 +++++- 12 files changed, 142 insertions(+), 31 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 37df5f719..9421816ff 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -190,9 +190,6 @@ void StartMap(const std::string &filename, bool clean) Invalidate(); CleanGame(); - //Wyrmgus start - CleanPlayers(); - //Wyrmgus end InterfaceState = IfaceStateMenu; SetDefaultTextColors(nc, rc); diff --git a/src/include/ui/popup.h b/src/include/ui/popup.h index 2c0252eb0..042373ba3 100644 --- a/src/include/ui/popup.h +++ b/src/include/ui/popup.h @@ -54,8 +54,8 @@ class PopupConditionPanel public: PopupConditionPanel() : HasHint(false), HasDescription(false), HasDependencies(false), //Wyrmgus start - Description(false), Quote(false), - AutoCast(0), Equipped(0), Equippable(0), Consumable(0), Affixed(0), Spell(0), CanUse(0), Work(0), ReadWork(0), Unique(0), Bound(0), Weapon(0), Shield(0), Boots(0), Arrows(0), Regeneration(0), + Class(false), Description(false), Quote(false), Encyclopedia(false), + Opponent(0), Neutral(0), AutoCast(0), Equipped(0), Equippable(0), Consumable(0), Affixed(0), Spell(0), CanUse(0), Work(0), ReadWork(0), Unique(0), Bound(0), Weapon(0), Shield(0), Boots(0), Arrows(0), Regeneration(0), // ButtonAction(-1), BoolFlags(NULL), Variables(NULL) {} ButtonAction(-1), ItemClass(-1), BoolFlags(NULL), Variables(NULL) {} //Wyrmgus end @@ -69,8 +69,10 @@ class PopupConditionPanel bool HasDescription; /// check if button has description. bool HasDependencies; /// check if button has dependencies or restrictions. //Wyrmgus start + bool Class; /// check if the button's unit type has a class. bool Description; /// check if the button's unit type has a description. bool Quote; /// check if the button's unit type has a quote. + bool Encyclopedia; /// check if the button's unit type has an encyclopedia entry. //Wyrmgus end int ButtonAction; /// action type of button //Wyrmgus start @@ -79,15 +81,17 @@ class PopupConditionPanel std::string ButtonValue; /// value used in ValueStr field of button //Wyrmgus start + char Opponent; /// check if button's item is an opponent + char Neutral; /// check if button's item is neutral char AutoCast; /// check if button's spell can be autocasted - char Equipped; /// check if button's item is equipped. - char Equippable; /// check if button's item is equippable by its owner. - char Consumable; /// check if button's item is consumable. + char Equipped; /// check if button's item is equipped + char Equippable; /// check if button's item is equippable by its owner + char Consumable; /// check if button's item is consumable char Affixed; /// check if button's item has an affix char Spell; /// check if button's item has a spell char CanUse; /// check if button's item's can be used - char Work; /// check if button's item is a work. - char ReadWork; /// check if button's item is a work that has been read. + char Work; /// check if button's item is a work + char ReadWork; /// check if button's item is a work that has been read char Unique; /// check if button's item is unique char Bound; /// check if button's item is bound to its owner char Weapon; /// check if button's item is a weapon diff --git a/src/include/upgrade.h b/src/include/upgrade.h index 4956b10dc..a18dd15ae 100644 --- a/src/include/upgrade.h +++ b/src/include/upgrade.h @@ -121,6 +121,7 @@ extern void AddUpgradeRequiredAbility(std::string upgrade_ident, std::string req extern void AddUpgradeWeaponClass(std::string upgrade_ident, int weapon_class); extern void SetUpgradeItem(std::string upgrade_ident, std::string item_ident); extern std::string GetUpgradeEffectsString(std::string upgrade_ident); +extern bool IsPercentageVariable(int var); //Wyrmgus end //@} diff --git a/src/stratagus/item.cpp b/src/stratagus/item.cpp index caac5b1f9..9a1a7549c 100644 --- a/src/stratagus/item.cpp +++ b/src/stratagus/item.cpp @@ -319,7 +319,7 @@ std::string GetItemEffectsString(std::string item_ident) item_effects_string += "+"; } item_effects_string += std::to_string((long long) item->DefaultStat.Variables[var].Value); - if (var == BACKSTAB_INDEX || var == BONUSAGAINSTMOUNTED_INDEX || var == BONUSAGAINSTBUILDINGS_INDEX || var == BONUSAGAINSTAIR_INDEX || var == BONUSAGAINSTGIANTS_INDEX || var == BONUSAGAINSTDRAGONS_INDEX || var == FIRERESISTANCE_INDEX || var == COLDRESISTANCE_INDEX || var == ARCANERESISTANCE_INDEX || var == LIGHTNINGRESISTANCE_INDEX || var == AIRRESISTANCE_INDEX || var == EARTHRESISTANCE_INDEX || var == WATERRESISTANCE_INDEX || var == HACKRESISTANCE_INDEX || var == PIERCERESISTANCE_INDEX || var == BLUNTRESISTANCE_INDEX) { + if (IsPercentageVariable(var)) { item_effects_string += "%"; } item_effects_string += " "; @@ -418,7 +418,7 @@ std::string GetUniqueItemEffectsString(std::string item_name) item_effects_string += "+"; } item_effects_string += std::to_string((long long) variable_value); - if (var == BACKSTAB_INDEX || var == BONUSAGAINSTMOUNTED_INDEX || var == BONUSAGAINSTBUILDINGS_INDEX || var == BONUSAGAINSTAIR_INDEX || var == BONUSAGAINSTGIANTS_INDEX || var == BONUSAGAINSTDRAGONS_INDEX || var == FIRERESISTANCE_INDEX || var == COLDRESISTANCE_INDEX || var == ARCANERESISTANCE_INDEX || var == LIGHTNINGRESISTANCE_INDEX || var == AIRRESISTANCE_INDEX || var == EARTHRESISTANCE_INDEX || var == WATERRESISTANCE_INDEX || var == HACKRESISTANCE_INDEX || var == PIERCERESISTANCE_INDEX || var == BLUNTRESISTANCE_INDEX || var == TIMEEFFICIENCYBONUS_INDEX) { + if (IsPercentageVariable(var)) { item_effects_string += "%"; } item_effects_string += " "; diff --git a/src/stratagus/player.cpp b/src/stratagus/player.cpp index 694779f5e..0a2f6e118 100644 --- a/src/stratagus/player.cpp +++ b/src/stratagus/player.cpp @@ -2258,7 +2258,7 @@ std::string GetFactionEffectsString(std::string civilization_name, std::string f effect_element_string += "+"; } effect_element_string += std::to_string((long long) variable_difference); - if (j == BACKSTAB_INDEX || j == BONUSAGAINSTMOUNTED_INDEX || j == BONUSAGAINSTBUILDINGS_INDEX || j == BONUSAGAINSTAIR_INDEX || j == BONUSAGAINSTGIANTS_INDEX || j == BONUSAGAINSTDRAGONS_INDEX || j == FIRERESISTANCE_INDEX || j == COLDRESISTANCE_INDEX || j == ARCANERESISTANCE_INDEX || j == LIGHTNINGRESISTANCE_INDEX || j == AIRRESISTANCE_INDEX || j == EARTHRESISTANCE_INDEX || j == WATERRESISTANCE_INDEX || j == HACKRESISTANCE_INDEX || j == PIERCERESISTANCE_INDEX || j == BLUNTRESISTANCE_INDEX || j == TIMEEFFICIENCYBONUS_INDEX) { + if (IsPercentageVariable(j)) { effect_element_string += "%"; } effect_element_string += " "; @@ -2320,7 +2320,7 @@ std::string GetFactionEffectsString(std::string civilization_name, std::string f faction_effects_string += "+"; } faction_effects_string += std::to_string((long long) UpgradeModifiers[z]->Modifier.Variables[j].Value); - if (j == BACKSTAB_INDEX || j == BONUSAGAINSTMOUNTED_INDEX || j == BONUSAGAINSTBUILDINGS_INDEX || j == BONUSAGAINSTAIR_INDEX || j == BONUSAGAINSTGIANTS_INDEX || j == BONUSAGAINSTDRAGONS_INDEX || j == FIRERESISTANCE_INDEX || j == COLDRESISTANCE_INDEX || j == ARCANERESISTANCE_INDEX || j == LIGHTNINGRESISTANCE_INDEX || j == AIRRESISTANCE_INDEX || j == EARTHRESISTANCE_INDEX || j == WATERRESISTANCE_INDEX || j == HACKRESISTANCE_INDEX || j == PIERCERESISTANCE_INDEX || j == BLUNTRESISTANCE_INDEX || j == TIMEEFFICIENCYBONUS_INDEX) { + if (IsPercentageVariable(j)) { faction_effects_string += "%"; } faction_effects_string += " "; diff --git a/src/tolua/player.pkg b/src/tolua/player.pkg index 5daf69272..1fc3532d3 100644 --- a/src/tolua/player.pkg +++ b/src/tolua/player.pkg @@ -76,6 +76,7 @@ extern CPlayer Players[PlayerMax]; extern CPlayer *ThisPlayer; //Wyrmgus start +extern void CleanPlayers(); extern void NetworkSetFaction(int player, std::string faction_name); extern std::string GetFactionEffectsString(std::string civilization_name, std::string faction_name); extern void GenerateMissingLanguageData(); diff --git a/src/ui/botpanel.cpp b/src/ui/botpanel.cpp index e4a1d4e16..3ca7179cd 100644 --- a/src/ui/botpanel.cpp +++ b/src/ui/botpanel.cpp @@ -396,6 +396,10 @@ static bool CanShowPopupContent(const PopupConditionPanel *condition, } //Wyrmgus start + if (condition->Class && type && type->Class.empty() && !(type->BoolFlag[ITEM_INDEX].value && type->ItemClass != -1)) { + return false; + } + if (condition->Description && type && type->Description.empty()) { return false; } @@ -403,6 +407,10 @@ static bool CanShowPopupContent(const PopupConditionPanel *condition, if (condition->Quote && type && type->Quote.empty() && !(button.Action == ButtonUnit && UnitManager.GetSlotUnit(button.Value).Unique && !GetUniqueItem(UnitManager.GetSlotUnit(button.Value).Name)->Quote.empty()) && !(button.Action == ButtonUnit && UnitManager.GetSlotUnit(button.Value).Work != NULL && !UnitManager.GetSlotUnit(button.Value).Work->Quote.empty())) { return false; } + + if (condition->Encyclopedia && type && type->Description.empty() && type->Background.empty() && type->Quote.empty() && (!type->BoolFlag[ITEM_INDEX].value || type->ItemClass == -1)) { + return false; + } //Wyrmgus end if (condition->ButtonAction != -1 && button.Action != condition->ButtonAction) { @@ -487,11 +495,6 @@ static bool CanShowPopupContent(const PopupConditionPanel *condition, return false; } } - if (condition->Affixed != CONDITION_TRUE) { - if ((condition->Affixed == CONDITION_ONLY) ^ (unit.Prefix != NULL || unit.Suffix != NULL)) { - return false; - } - } if (condition->Spell != CONDITION_TRUE) { if ((condition->Spell == CONDITION_ONLY) ^ (unit.Spell != NULL)) { return false; @@ -512,11 +515,6 @@ static bool CanShowPopupContent(const PopupConditionPanel *condition, return false; } } - if (condition->Unique != CONDITION_TRUE) { - if ((condition->Unique == CONDITION_ONLY) ^ (unit.Unique || unit.Character != NULL)) { - return false; - } - } if (condition->Bound != CONDITION_TRUE) { if ((condition->Bound == CONDITION_ONLY) ^ unit.Bound) { return false; @@ -559,6 +557,39 @@ static bool CanShowPopupContent(const PopupConditionPanel *condition, } } } + + if (condition->Opponent != CONDITION_TRUE) { + if ((condition->Opponent == CONDITION_ONLY) ^ ThisPlayer->IsEnemy(unit)) { + return false; + } + } + if (condition->Neutral != CONDITION_TRUE) { + if ((condition->Neutral == CONDITION_ONLY) ^ (!ThisPlayer->IsEnemy(unit) && !ThisPlayer->IsAllied(unit) && ThisPlayer != unit.Player && (unit.Container == NULL || (!ThisPlayer->IsEnemy(*unit.Container) && !ThisPlayer->IsAllied(*unit.Container) && ThisPlayer != unit.Container->Player)))) { + return false; + } + } + + if (condition->Affixed != CONDITION_TRUE) { + if ((condition->Affixed == CONDITION_ONLY) ^ (unit.Prefix != NULL || unit.Suffix != NULL)) { + return false; + } + } + if (condition->Unique != CONDITION_TRUE) { + if ((condition->Unique == CONDITION_ONLY) ^ (unit.Unique || unit.Character != NULL)) { + return false; + } + } + } else { // always return false for "Affixed" and "Unique" for buttons that aren't individual unit buttons + if (condition->Affixed != CONDITION_TRUE) { + if (condition->Affixed == CONDITION_ONLY) { + return false; + } + } + if (condition->Unique != CONDITION_TRUE) { + if (condition->Unique == CONDITION_ONLY) { + return false; + } + } } //Wyrmgus end diff --git a/src/ui/mainscr.cpp b/src/ui/mainscr.cpp index 92c63dff1..58d0f65f5 100644 --- a/src/ui/mainscr.cpp +++ b/src/ui/mainscr.cpp @@ -531,8 +531,16 @@ static void DrawUnitInfo_portrait(const CUnit &unit) #endif if (UI.SingleSelectedButton) { const PixelPos pos(UI.SingleSelectedButton->X, UI.SingleSelectedButton->Y); - const int flag = (ButtonAreaUnderCursor == ButtonAreaSelected && ButtonUnderCursor == 0) ? - (IconActive | (MouseButtons & LeftButton)) : 0; + //Wyrmgus start +// const int flag = (ButtonAreaUnderCursor == ButtonAreaSelected && ButtonUnderCursor == 0) ? +// (IconActive | (MouseButtons & LeftButton)) : 0; + int flag = (ButtonAreaUnderCursor == ButtonAreaSelected && ButtonUnderCursor == 0) ? + IconActive : 0; + + if (flag == IconActive && ((MouseButtons & LeftButton) || (MouseButtons & MiddleButton) || (MouseButtons & RightButton))) { + flag = IconClicked; + } + //Wyrmgus end //Wyrmgus start // type.Icon.Icon->DrawUnitIcon(*UI.SingleSelectedButton->Style, flag, pos, "", unit.RescuedFrom ? unit.RescuedFrom->Index : unit.Player->Index); @@ -1540,7 +1548,16 @@ static void InfoPanel_draw_single_selection(CUnit *selUnit) if (!Preference.NoStatusLineTooltips) { UI.StatusLine.Set(unit.GetMessageName()); } - DrawGenericPopup(unit.GetMessageName(), UI.SingleSelectedButton->X, UI.SingleSelectedButton->Y); + + //hackish way to make the popup appear correctly for the single selected unit + ButtonAction *ba = new ButtonAction; + ba->Hint = unit.GetMessageName(); + ba->Action = ButtonUnit; + ba->Value = UnitNumber(unit); + ba->Popup = "popup-unit"; + DrawPopup(*ba, *UI.SingleSelectedButton, UI.SingleSelectedButton->X, UI.SingleSelectedButton->Y); + delete ba; + LastDrawnButtonPopup = NULL; //Wyrmgus end } } diff --git a/src/ui/mouse.cpp b/src/ui/mouse.cpp index e48d0fc76..2545b0181 100644 --- a/src/ui/mouse.cpp +++ b/src/ui/mouse.cpp @@ -46,6 +46,9 @@ #include "action/action_build.h" #include "action/action_train.h" #include "actions.h" +//Wyrmgus start +#include "character.h" +//Wyrmgus end #include "commands.h" #include "cursor.h" #include "font.h" @@ -2132,6 +2135,8 @@ static void UIHandleButtonDown_OnButton(unsigned button) } } } else if ((MouseButtons & MiddleButton)) { + //Wyrmgus start + /* // clicked on info panel - single unit shown if (ButtonAreaUnderCursor == ButtonAreaSelected && ButtonUnderCursor == 0 && Selected.size() == 1) { PlayGameSound(GameSounds.Click.Sound, MaxSampleVolume); @@ -2141,6 +2146,8 @@ static void UIHandleButtonDown_OnButton(unsigned button) UI.SelectedViewport->Unit = Selected[0]; } } + */ + //Wyrmgus end } else if ((MouseButtons & RightButton)) { } } @@ -2156,7 +2163,27 @@ static void UIHandleButtonUp_OnButton(unsigned button) // clicked on single unit shown if (ButtonUnderCursor == 0 && Selected.size() == 1) { PlayGameSound(GameSounds.Click.Sound, MaxSampleVolume); - UI.SelectedViewport->Center(Selected[0]->GetMapPixelPosCenter()); + if ((1 << button) == LeftButton) { + UI.SelectedViewport->Center(Selected[0]->GetMapPixelPosCenter()); + } else if ((1 << button) == RightButton) { + std::string encyclopedia_ident = Selected[0]->Type->Ident; + std::string encyclopedia_state = "units"; + if (Selected[0]->Character != NULL && Selected[0]->Character->Persistent && !Selected[0]->Character->Custom) { + encyclopedia_ident = Selected[0]->Character->GetFullName(); + encyclopedia_state = "heroes"; + } else if (Selected[0]->Unique && GetUniqueItem(Selected[0]->Name) != NULL) { + encyclopedia_ident = Selected[0]->Name; + encyclopedia_state = "unique_items"; + } + CclCommand("if (OpenEncyclopediaUnitEntry ~= nil) then OpenEncyclopediaUnitEntry(\"" + encyclopedia_ident + "\", \"" + encyclopedia_state + "\") end;"); + } else if ((1 << button) == MiddleButton) { + // clicked on info panel - single unit shown + if (UI.SelectedViewport->Unit == Selected[0]) { + UI.SelectedViewport->Unit = NULL; + } else { + UI.SelectedViewport->Unit = Selected[0]; + } + } } // clicked on training button } else if (ButtonAreaUnderCursor == ButtonAreaTraining) { @@ -2388,7 +2415,17 @@ void UIHandleButtonUp(unsigned button) //Wyrmgus start // if ((1 << button) == LeftButton) { - if ((1 << button) == LeftButton || ((1 << button) == RightButton && ButtonAreaUnderCursor == ButtonAreaInventory)) { + if ( + (1 << button) == LeftButton + || ( + (1 << button) == RightButton + && (ButtonAreaUnderCursor == ButtonAreaInventory || (ButtonAreaUnderCursor == ButtonAreaSelected && ButtonUnderCursor == 0 && Selected.size() == 1)) + ) + || ( + (1 << button) == MiddleButton + && (ButtonAreaUnderCursor == ButtonAreaSelected && ButtonUnderCursor == 0 && Selected.size() == 1) + ) + ) { //Wyrmgus end // // Menu (F10) button diff --git a/src/ui/popup.cpp b/src/ui/popup.cpp index 19e0c45b3..a541e6954 100644 --- a/src/ui/popup.cpp +++ b/src/ui/popup.cpp @@ -48,6 +48,9 @@ #include "unit_manager.h" //Wyrmgus end #include "unittype.h" +//Wyrmgus start +#include "upgrade.h" +//Wyrmgus end #include "video.h" /* virtual */ int CPopupContentTypeButtonInfo::GetWidth(const ButtonAction &button, int *) const @@ -532,7 +535,10 @@ CPopupContentTypeLine::CPopupContentTypeLine() : Color(ColorWhite), Width(0), He value = UnitManager.GetSlotUnit(button.Value).Variable[this->Index].Value; } } - label.Draw(x, y, value); + x += label.Draw(x, y, value); + if (IsPercentageVariable(this->Index)) { + x += label.Draw(x, y, "%"); + } //Wyrmgus end } } @@ -587,10 +593,14 @@ static PopupConditionPanel *ParsePopupConditions(lua_State *l) } else if (!strcmp(key, "HasDependencies")) { condition->HasDependencies = LuaToBoolean(l, -1); //Wyrmgus start + } else if (!strcmp(key, "Class")) { + condition->Class = LuaToBoolean(l, -1); } else if (!strcmp(key, "Description")) { condition->Description = LuaToBoolean(l, -1); } else if (!strcmp(key, "Quote")) { condition->Quote = LuaToBoolean(l, -1); + } else if (!strcmp(key, "Encyclopedia")) { + condition->Encyclopedia = LuaToBoolean(l, -1); //Wyrmgus end } else if (!strcmp(key, "ButtonValue")) { condition->ButtonValue = LuaToString(l, -1); @@ -651,6 +661,10 @@ static PopupConditionPanel *ParsePopupConditions(lua_State *l) } //Wyrmgus end //Wyrmgus start + } else if (!strcmp(key, "Opponent")) { + condition->Opponent = Ccl2Condition(l, LuaToString(l, -1)); + } else if (!strcmp(key, "Neutral")) { + condition->Neutral = Ccl2Condition(l, LuaToString(l, -1)); } else if (!strcmp(key, "AutoCast")) { condition->AutoCast = Ccl2Condition(l, LuaToString(l, -1)); } else if (!strcmp(key, "Equipped")) { diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 37f290b1d..e602f4049 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -4085,6 +4085,10 @@ bool CUnit::CanUseItem(CUnit *item) const return false; } + if (item->Type->BoolFlag[ITEM_INDEX].value && item->Type->ItemClass != FoodItemClass && item->Type->ItemClass != PotionItemClass && item->Type->ItemClass != ScrollItemClass) { + return false; + } + if (item->Spell != NULL) { if (!this->HasInventory() || !CanCastSpell(*this, *item->Spell, this, this->tilePos)) { return false; diff --git a/src/unit/upgrade.cpp b/src/unit/upgrade.cpp index 377b840c5..80d4e1851 100644 --- a/src/unit/upgrade.cpp +++ b/src/unit/upgrade.cpp @@ -1983,7 +1983,7 @@ std::string GetUpgradeEffectsString(std::string upgrade_ident) upgrade_effects_string += "+"; } upgrade_effects_string += std::to_string((long long) UpgradeModifiers[z]->Modifier.Variables[var].Value); - if (var == BACKSTAB_INDEX || var == BONUSAGAINSTMOUNTED_INDEX || var == BONUSAGAINSTBUILDINGS_INDEX || var == BONUSAGAINSTAIR_INDEX || var == BONUSAGAINSTGIANTS_INDEX || var == BONUSAGAINSTDRAGONS_INDEX || var == FIRERESISTANCE_INDEX || var == COLDRESISTANCE_INDEX || var == ARCANERESISTANCE_INDEX || var == LIGHTNINGRESISTANCE_INDEX || var == AIRRESISTANCE_INDEX || var == EARTHRESISTANCE_INDEX || var == WATERRESISTANCE_INDEX || var == HACKRESISTANCE_INDEX || var == PIERCERESISTANCE_INDEX || var == BLUNTRESISTANCE_INDEX || var == TIMEEFFICIENCYBONUS_INDEX) { + if (IsPercentageVariable(var)) { upgrade_effects_string += "%"; } upgrade_effects_string += " "; @@ -2043,6 +2043,11 @@ std::string GetUpgradeEffectsString(std::string upgrade_ident) return ""; } + +bool IsPercentageVariable(int var) +{ + return var == BACKSTAB_INDEX || var == BONUSAGAINSTMOUNTED_INDEX || var == BONUSAGAINSTBUILDINGS_INDEX || var == BONUSAGAINSTAIR_INDEX || var == BONUSAGAINSTGIANTS_INDEX || var == BONUSAGAINSTDRAGONS_INDEX || var == FIRERESISTANCE_INDEX || var == COLDRESISTANCE_INDEX || var == ARCANERESISTANCE_INDEX || var == LIGHTNINGRESISTANCE_INDEX || var == AIRRESISTANCE_INDEX || var == EARTHRESISTANCE_INDEX || var == WATERRESISTANCE_INDEX || var == HACKRESISTANCE_INDEX || var == PIERCERESISTANCE_INDEX || var == BLUNTRESISTANCE_INDEX || var == TIMEEFFICIENCYBONUS_INDEX; +} //Wyrmgus end //@}