Page 1 of 1

BioTypes and the great refactoring

Posted: Sun Jan 09, 2022 11:23 am
by captainsnarf
Download here BioTypes_1.0.zip

"Bio is immune to Bio"

This package includes the base types needed to make that happen. Previously everybody was piggybacking off of the CSBadgerFix package to get the bio types.
Includes two vehicle damage types -

DamTypeBioBeam - base class to use for beam type weapon damage types.
DamTypeBioGlobVehicle - base class to use for bio glob damage types.


This also includes a class with a static helper method

Code: Select all

class BioHandler extends Object
    abstract;
static function bool IsBioDamage(class<DamageType> DamageType);
You can use it in your TakeDamage function e.g.

Code: Select all

function TakeDamage(int Damage, Pawn instigatedBy, Vector Hitlocation, Vector Momentum, class<DamageType> DamageType)
{

  //don't take damage from bio
  if(class'BioHandler'.static.IsBioDamage(DamageType))
        return;

    Super.TakeDamage(Damage, instigatedBy, Hitlocation, Momentum, damageType);
}

Re: BioTypes and the great refactoring

Posted: Sun Jan 09, 2022 4:29 pm
by pooty
Very nice. I'll look at getting all the updates on the server later this week.

Might have to do the same for the fire vehicles.. I set those up so that the fire vehicles have resistance to the various fire damage types, but the fire badger (in CSBadgerFix doesn;t unless Snarf put it in) and the fire ant doesn't. Makes me wonder if the Dragon should. This neatly allows us to tailor a few things..and perhaps make some vehicles more vulnerable to fire..