Skip to content

Instantly share code, notes, and snippets.

@Cyken-Zeraux
Last active December 30, 2016 04:51
Show Gist options
  • Save Cyken-Zeraux/ab91ec757f42a7d9fde262a452f75b75 to your computer and use it in GitHub Desktop.
Save Cyken-Zeraux/ab91ec757f42a7d9fde262a452f75b75 to your computer and use it in GitHub Desktop.
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