MantisBT - Zandronum
View Issue Details
0001283Zandronum[All Projects] Suggestionpublic2013-02-17 18:552019-06-04 21:54
Dusk 
Dusk 
normalmajorN/A
newopen 
 
 
0001283: Spread rune revamp
Thought to do some science. :P

'https://bitbucket.org/CrimsonDusk/neurosphere/commits [^]'

So far it's working, though it's obviously going to need a good bit of testing to make sure it functions properly.

I've added a layer of wrapper functions into a p_spreadrune.cpp. They call P_LineAttack, P_SpawnPlayerMissile and so on and return an array containing all missiles/puffs spawned. I've gone through every weapon and updated them to use the new wrapper functions.

As a result, the spread rune behavior is pretty much centralized to one code file.

Right now I'm gonna try see if I can get this tested on neurosphere somehow to ensure everything behaves as they should. The fun bit is that this code could also allow for customizable spread runes.
TArray<AActor*> P_SpreadLineAttack( AActor *t1, angle_t angle, fixed_t distance,
    int pitch, int damage, FName damageType, const PClass *pufftype, bool ismelee = false );
TArray<AActor*> P_SpreadLineAttack( AActor *t1, angle_t angle, fixed_t distance,
    int pitch, int damage, FName damageType, FName pufftype, bool ismelee = false );
-----------------------------
This one does spread-savvy P_LineAttack and returns an array of puffs spawned.

-----------------------------
TArray<AActor*> P_SpreadRuneMissile (AActor *source, const PClass *type);
TArray<AActor*> P_SpreadRuneMissile (AActor *source, const PClass *type, angle_t angle, bool bSpawnSound = true );
TArray<AActor*> P_SpreadRuneMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, const PClass *type, angle_t angle,
    AActor **pLineTarget = NULL, AActor **MissileActor = NULL, bool nofreeaim = false, bool bSpawnSound = true,
    bool bSpawnOnClient = true, bool bReturnMissileActors = false );
-----------------------------
Spread-version of P_SpawnPlayerMissile, spawns missiles, takes spread into account and returns an array of the missiles. bReturnMissileActors causes the function to return the pMissileActors of the calls instead of return values for Heretic's powered skull rod.

TArray<AActor*> P_SpreadSpawn( const char *type, fixed_t x, fixed_t y, fixed_t z,
    replace_t allowreplacement, AActor* runeholder, bool bSetAngle );
-----------------------------
This is Spawn that takes spread into account. runeholder is the player actor who is supposed to have the rune. If bSetAngle is set to true, every spawned actor has their angle set to face their spread direction.

TArray<AActor*> P_SpreadRuneSubMissile( AActor *source, const PClass *type, AActor *target );
TArray<AActor*> P_SpreadRuneMissileAngle( AActor *source, const PClass *type, angle_t angle, fixed_t momz );
-----------------------------
The former one is for Strife (P_SpawnSubMissile), the latter one is for Heretic (P_SpawnMissileAngle)

bool P_ActorHasSpreadRune( AActor* mo );
-----------------------------
Returns true if the actor has the spread rune

ULONG P_SpreadRuneMultiplier( AActor* mo );
-----------------------------
Amount of missiles the player will shoot (right now either 1 or 3)

angle_t P_SpreadRuneCone( AActor* mo );
-----------------------------
Cone of missile spread, either 0 or ANGLE_60 / 2

angle_t P_SpreadRuneAngle( AActor* mo, ULONG ulDelta );
-----------------------------
Calculates angles for individual missiles.
No tags attached.
parent of 0000136new  Spread rune does not with Strife weapon 
Not all the children of this issue are yet resolved or closed.
Issue History
2013-02-17 18:55DuskNew Issue
2013-02-17 18:55DuskStatusnew => assigned
2013-02-17 18:55DuskAssigned To => Dusk
2013-02-17 19:02DuskAdditional Information Updatedbug_revision_view_page.php?rev_id=3340#r3340
2014-06-19 11:44DuskRelationship addedparent of 0000136
2019-06-04 21:54DuskStatusassigned => new

There are no notes attached to this issue.