by Major Cooke » Tue Mar 03, 2015 9:38 am
I've begun working on NoBlockMask and NoClipMask. I changed it from BlockMask/ClipMask to "No" version because otherwise users would have to keep track of which flags they would need to follow through with, and in relation to THRU flags, it's the same as having the No affixed to it.
Graf/Randi: I've got the property made now, and a function to control it.
Still a WIP, but I wanted to check: I should replace the flag checks where appropriate, and have A_ChangeFlag simply add/subtract the flag from their masks, right? Somewhat like I did here:
Code: Select all
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(NoClipMask, O, Actor) //O has been set up to parse mask flags
{
// What doesn't the actor block?
PROP_INT_PARM(val, 0);
// [MC] Handle actor flags here.
// MASK_ALl doesn't combine all of them, because this could break things like bullet
// puffs with species. Instead, it'll just take priority like the THRUACTORS flag does.
if ((defaults->flags2 & MF2_THRUACTORS) && !(val & MASK_All))
val += MASK_All;
if ((defaults->flags2 & MF2_THRUGHOST) && !(val & MASK_Ghost))
val += MASK_Ghost;
if ((defaults->flags2 & MF6_THRUSPECIES) && !(val & MASK_Species))
val += MASK_Species;
if ((defaults->flags2 & MF6_MTHRUSPECIES) && !(val & MASK_MSpecies))
val += MASK_MSpecies;
if (val)
defaults->NoClipMask = val;
else
defaults->NoClipMask = MASK_Default;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(NoBlockMask, O, Actor)
{
// What isn't the actor blocked by?
PROP_INT_PARM(val, 0);
if ((defaults->flags2 & MF2_THRUACTORS) && !(val & MASK_All))
val += MASK_All;
if ((defaults->flags2 & MF2_THRUGHOST) && !(val & MASK_Ghost))
val += MASK_Ghost;
if ((defaults->flags2 & MF6_THRUSPECIES) && !(val & MASK_Species))
val += MASK_Species;
if ((defaults->flags2 & MF6_MTHRUSPECIES) && !(val & MASK_MSpecies))
val += MASK_MSpecies;
if (val)
defaults->NoBlockMask = val;
else
defaults->NoBlockMask = MASK_Default;
}
I've begun working on NoBlockMask and NoClipMask. I changed it from BlockMask/ClipMask to "No" version because otherwise users would have to keep track of which flags they would need to follow through with, and in relation to THRU flags, it's the same as having the No affixed to it.
Graf/Randi: I've got the property made now, and a function to control it.
Still a WIP, but I wanted to check: I should replace the flag checks where appropriate, and have A_ChangeFlag simply add/subtract the flag from their masks, right? Somewhat like I did here:
[code]//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(NoClipMask, O, Actor) //O has been set up to parse mask flags
{
// What doesn't the actor block?
PROP_INT_PARM(val, 0);
// [MC] Handle actor flags here.
// MASK_ALl doesn't combine all of them, because this could break things like bullet
// puffs with species. Instead, it'll just take priority like the THRUACTORS flag does.
if ((defaults->flags2 & MF2_THRUACTORS) && !(val & MASK_All))
val += MASK_All;
if ((defaults->flags2 & MF2_THRUGHOST) && !(val & MASK_Ghost))
val += MASK_Ghost;
if ((defaults->flags2 & MF6_THRUSPECIES) && !(val & MASK_Species))
val += MASK_Species;
if ((defaults->flags2 & MF6_MTHRUSPECIES) && !(val & MASK_MSpecies))
val += MASK_MSpecies;
if (val)
defaults->NoClipMask = val;
else
defaults->NoClipMask = MASK_Default;
}
//==========================================================================
//
//==========================================================================
DEFINE_PROPERTY(NoBlockMask, O, Actor)
{
// What isn't the actor blocked by?
PROP_INT_PARM(val, 0);
if ((defaults->flags2 & MF2_THRUACTORS) && !(val & MASK_All))
val += MASK_All;
if ((defaults->flags2 & MF2_THRUGHOST) && !(val & MASK_Ghost))
val += MASK_Ghost;
if ((defaults->flags2 & MF6_THRUSPECIES) && !(val & MASK_Species))
val += MASK_Species;
if ((defaults->flags2 & MF6_MTHRUSPECIES) && !(val & MASK_MSpecies))
val += MASK_MSpecies;
if (val)
defaults->NoBlockMask = val;
else
defaults->NoBlockMask = MASK_Default;
}[/code]