mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-29 12:52:18 -05:00
CC: No longer rely on received parameter to be 0 (#2870)
This commit is contained in:
parent
2ea72f835a
commit
23d89122b3
@ -417,6 +417,7 @@ CrowdControl::Effect* CrowdControl::ParseMessage(char payload[512]) {
|
|||||||
break;
|
break;
|
||||||
case kEffectFillHeart:
|
case kEffectFillHeart:
|
||||||
effect->giEffect = new GameInteractionEffect::ModifyHealth();
|
effect->giEffect = new GameInteractionEffect::ModifyHealth();
|
||||||
|
effect->giEffect->parameters[0] = receivedParameter;
|
||||||
break;
|
break;
|
||||||
case kEffectKnockbackLinkWeak:
|
case kEffectKnockbackLinkWeak:
|
||||||
effect->giEffect = new GameInteractionEffect::KnockbackPlayer();
|
effect->giEffect = new GameInteractionEffect::KnockbackPlayer();
|
||||||
@ -454,6 +455,7 @@ CrowdControl::Effect* CrowdControl::ParseMessage(char payload[512]) {
|
|||||||
break;
|
break;
|
||||||
case kEffectAddRupees:
|
case kEffectAddRupees:
|
||||||
effect->giEffect = new GameInteractionEffect::ModifyRupees();
|
effect->giEffect = new GameInteractionEffect::ModifyRupees();
|
||||||
|
effect->giEffect->parameters[0] = receivedParameter;
|
||||||
break;
|
break;
|
||||||
case kEffectGiveDekuShield:
|
case kEffectGiveDekuShield:
|
||||||
effect->giEffect = new GameInteractionEffect::GiveOrTakeShield();
|
effect->giEffect = new GameInteractionEffect::GiveOrTakeShield();
|
||||||
@ -465,26 +467,32 @@ CrowdControl::Effect* CrowdControl::ParseMessage(char payload[512]) {
|
|||||||
break;
|
break;
|
||||||
case kEffectRefillSticks:
|
case kEffectRefillSticks:
|
||||||
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
||||||
|
effect->giEffect->parameters[0] = receivedParameter;
|
||||||
effect->giEffect->parameters[1] = ITEM_STICK;
|
effect->giEffect->parameters[1] = ITEM_STICK;
|
||||||
break;
|
break;
|
||||||
case kEffectRefillNuts:
|
case kEffectRefillNuts:
|
||||||
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
||||||
|
effect->giEffect->parameters[0] = receivedParameter;
|
||||||
effect->giEffect->parameters[1] = ITEM_NUT;
|
effect->giEffect->parameters[1] = ITEM_NUT;
|
||||||
break;
|
break;
|
||||||
case kEffectRefillBombs:
|
case kEffectRefillBombs:
|
||||||
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
||||||
|
effect->giEffect->parameters[0] = receivedParameter;
|
||||||
effect->giEffect->parameters[1] = ITEM_BOMB;
|
effect->giEffect->parameters[1] = ITEM_BOMB;
|
||||||
break;
|
break;
|
||||||
case kEffectRefillSeeds:
|
case kEffectRefillSeeds:
|
||||||
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
||||||
|
effect->giEffect->parameters[0] = receivedParameter;
|
||||||
effect->giEffect->parameters[1] = ITEM_SLINGSHOT;
|
effect->giEffect->parameters[1] = ITEM_SLINGSHOT;
|
||||||
break;
|
break;
|
||||||
case kEffectRefillArrows:
|
case kEffectRefillArrows:
|
||||||
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
||||||
|
effect->giEffect->parameters[0] = receivedParameter;
|
||||||
effect->giEffect->parameters[1] = ITEM_BOW;
|
effect->giEffect->parameters[1] = ITEM_BOW;
|
||||||
break;
|
break;
|
||||||
case kEffectRefillBombchus:
|
case kEffectRefillBombchus:
|
||||||
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
effect->giEffect = new GameInteractionEffect::AddOrTakeAmmo();
|
||||||
|
effect->giEffect->parameters[0] = receivedParameter;
|
||||||
effect->giEffect->parameters[1] = ITEM_BOMBCHU;
|
effect->giEffect->parameters[1] = ITEM_BOMBCHU;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -811,16 +819,6 @@ CrowdControl::Effect* CrowdControl::ParseMessage(char payload[512]) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no value is specifically set, default to using whatever CC sends us.
|
|
||||||
// Values are used for various things depending on the effect, but they
|
|
||||||
// usually represent the "amount" of an effect. Amount of hearts healed,
|
|
||||||
// strength of knockback, etc.
|
|
||||||
if (effect->giEffect != NULL) {
|
|
||||||
if (!effect->giEffect->parameters[0]) {
|
|
||||||
effect->giEffect->parameters[0] = receivedParameter;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return effect;
|
return effect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user