the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 69 lines 2.0 kB view raw
1#pragma once 2 3/* 44J - Both modifier uuid and name have been replaced by an id enum. Note that we have special value 5"eModifierId_ANONYMOUS" for attribute modifiers that previously didn't have a fixed UUID and are never removed. 6 7To all intents and purposes anonymous modifiers don't have an ID and so are handled differently in some cases, for instance: 8 1. You can have multiple modifiers with the anonymous ID on a single attribute instance 9 2. Anonymous modifiers can't be removed from attribute instance by ID 10 11IMPORTANT: Saved out to file so don't change order. All new values should be added at the end. 12*/ 13 14class HtmlString; 15 16enum eMODIFIER_ID 17{ 18 eModifierId_ANONYMOUS = 0, 19 20 eModifierId_ITEM_BASEDAMAGE, 21 22 eModifierId_MOB_FLEEING, 23 eModifierId_MOB_SPRINTING, 24 25 eModifierId_MOB_ENDERMAN_ATTACKSPEED, 26 eModifierId_MOB_PIG_ATTACKSPEED, 27 eModifierId_MOB_WITCH_DRINKSPEED, 28 eModifierId_MOB_ZOMBIE_BABYSPEED, 29 30 eModifierId_POTION_DAMAGEBOOST, 31 eModifierId_POTION_HEALTHBOOST, 32 eModifierId_POTION_MOVESPEED, 33 eModifierId_POTION_MOVESLOWDOWN, 34 eModifierId_POTION_WEAKNESS, 35 36 eModifierId_COUNT, 37}; 38 39class AttributeModifier 40{ 41public: 42 static const int OPERATION_ADDITION = 0; 43 static const int OPERATION_MULTIPLY_BASE = 1; 44 static const int OPERATION_MULTIPLY_TOTAL = 2; 45 static const int TOTAL_OPERATIONS = 3; 46 47private: 48 double amount; 49 int operation; 50 wstring name; 51 eMODIFIER_ID id; 52 bool serialize; 53 54 void _init(eMODIFIER_ID id, const wstring name, double amount, int operation); 55 56public: 57 AttributeModifier(double amount, int operation); 58 AttributeModifier(eMODIFIER_ID id, double amount, int operation); 59 60 eMODIFIER_ID getId(); 61 wstring getName(); 62 int getOperation(); 63 double getAmount(); 64 bool isSerializable(); 65 AttributeModifier *setSerialize(bool serialize); 66 bool equals(AttributeModifier *modifier); 67 wstring toString(); 68 HtmlString getHoverText(eATTRIBUTE_ID attribute); // 4J: Added to keep modifier readable string creation in one place 69};