Last active
December 30, 2016 04:51
-
-
Save Cyken-Zeraux/ab91ec757f42a7d9fde262a452f75b75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static MyStringHash damageTypeDeformation = MyStringHash.GetOrCompute("Deformation"); | |
//The global damage handler | |
void GlobalDamageHandler(object target, ref MyDamageInformation info) | |
{ | |
//Check that the game is initialized | |
if (m_init) | |
{ | |
//Cast to the 'block' class | |
IMySlimBlock slimBlock = target as IMySlimBlock; | |
//var asdf = slimBlock as MyCubeBlock; | |
//asdf.StopDamageEffect(); | |
//Make sure its actually a block | |
if (slimBlock != null) | |
{ | |
//Check if damage type is 'Deformation' type we set above. | |
if (damageTypeDeformation.Equals(info.Type)) | |
{ | |
//Change the amount of deformation to 0. | |
info.Amount = 0; | |
return; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment