From 37f6c78404aeb92a40c1a96c856e69225788c3db Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 1 Jul 2013 18:46:45 +0000 Subject: Added DamageType translation to API git-svn-id: http://mc-server.googlecode.com/svn/trunk@1639 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/BlockID.h | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'source/BlockID.h') diff --git a/source/BlockID.h b/source/BlockID.h index 7e03388d3..9b2a104f3 100644 --- a/source/BlockID.h +++ b/source/BlockID.h @@ -614,6 +614,48 @@ enum eDimension } ; + + + +/// Damage type, used in the TakeDamageInfo structure and related functions +enum eDamageType +{ + // Canonical names for the types (as documented in the plugin wiki): + dtAttack, // Being attacked by a mob + dtLightning, // Hit by a lightning strike + dtFalling, // Falling down; dealt when hitting the ground + dtDrowning, // Drowning in water / lava + dtSuffocating, // Suffocating inside a block + dtStarving, // Hunger + dtCactusContact, // Contact with a cactus block + dtLavaContact, // Contact with a lava block + dtPoisoning, // Having the poison effect + dtOnFire, // Being on fire + dtFireContact, // Standing inside a fire block + dtInVoid, // Falling into the Void (Y < 0) + dtPotionOfHarming, + dtAdmin, // Damage applied by an admin command + + // Some common synonyms: + dtPawnAttack = dtAttack, + dtEntityAttack = dtAttack, + dtMob = dtAttack, + dtMobAttack = dtAttack, + dtFall = dtFalling, + dtDrown = dtDrowning, + dtSuffocation = dtSuffocating, + dtStarvation = dtStarving, + dtHunger = dtStarving, + dtCactus = dtCactusContact, + dtCactuses = dtCactusContact, + dtCacti = dtCactusContact, + dtLava = dtLavaContact, + dtPoison = dtPoisoning, + dtBurning = dtOnFire, + dtInFire = dtFireContact, + dtPlugin = dtAdmin, +} ; + // tolua_end @@ -649,6 +691,12 @@ extern EMCSBiome StringToBiome(const AString & a_BiomeString); /// Translates a dimension string to dimension enum. Takes either a number or a dimension alias (built-in). Returns -1000 on failure extern eDimension StringToDimension(const AString & a_DimensionString); +/// Translates damage type constant to a string representation (built-in). +extern AString DamageTypeToString(eDamageType a_DamageType); + +/// Translates a damage type string to damage type. Takes either a number or a damage type alias (built-in). Returns -1 on failure +extern eDamageType StringToDamageType(const AString & a_DamageString); + // tolua_end -- cgit v1.2.3