Corgi Engine  v8.8
MoreMountains.CorgiEngine.WeaponAmmo Class Reference
Inheritance diagram for MoreMountains.CorgiEngine.WeaponAmmo:
MoreMountains.CorgiEngine.CorgiMonoBehaviour MoreMountains.Tools.MMEventListener< MMInventoryEvent > MoreMountains.Tools.MMEventListener< MMGameEvent >

Public Member Functions

virtual bool EnoughAmmoToFire ()
 
virtual void FillWeaponWithAmmo ()
 
virtual void EmptyMagazine (bool shouldSave)
 Empties the weapon's magazine and puts the ammo back in the inventory More...
 
virtual void OnMMEvent (MMStateChangeEvent< MoreMountains.CorgiEngine.Weapon.WeaponStates > weaponEvent)
 
virtual void OnMMEvent (MMInventoryEvent inventoryEvent)
 On pick we refresh our ammo if needed More...
 
virtual void OnMMEvent (MMGameEvent gameEvent)
 Grabs inventory events and refreshes ammo if needed More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< MMInventoryEvent >
void OnMMEvent (T eventType)
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< MMGameEvent >
void OnMMEvent (T eventType)
 

Public Attributes

string AmmoID
 the AmmoID that matches the one on the ammo this weapon should use More...
 
string AmmoInventoryName = "MainInventory"
 the name of the inventory where the system should look for ammo More...
 
int MaxAmmo = 100
 the theoretical maximum of ammo More...
 
bool ShouldLoadOnStart = true
 if this is true, everytime you equip this weapon, it'll auto fill with ammo More...
 
bool ShouldEmptyOnSave = true
 if this is true, everytime you equip this weapon, it'll auto fill with ammo More...
 
int CurrentAmmoAvailable
 the current amount of ammo available in the inventory More...
 

Protected Member Functions

virtual void Start ()
 
virtual void LoadOnStart ()
 
virtual void RefreshCurrentAmmoAvailable ()
 
virtual void ConsumeAmmo ()
 
IEnumerator DelayedRefreshCurrentAmmoAvailable ()
 
void OnDestroy ()
 
virtual void OnEnable ()
 On enable, we start listening for MMGameEvents. You may want to extend that to listen to other types of events. More...
 
virtual void OnDisable ()
 On disable, we stop listening for MMGameEvents. You may want to extend that to stop listening to other types of events. More...
 

Protected Attributes

Weapon _weapon
 
InventoryItem _ammoItem
 
bool _emptied = false
 

Properties

Inventory AmmoInventory [get, set]
 

Member Function Documentation

◆ ConsumeAmmo()

virtual void MoreMountains.CorgiEngine.WeaponAmmo.ConsumeAmmo ( )
protectedvirtual

◆ DelayedRefreshCurrentAmmoAvailable()

IEnumerator MoreMountains.CorgiEngine.WeaponAmmo.DelayedRefreshCurrentAmmoAvailable ( )
protected

◆ EmptyMagazine()

virtual void MoreMountains.CorgiEngine.WeaponAmmo.EmptyMagazine ( bool  shouldSave)
virtual

Empties the weapon's magazine and puts the ammo back in the inventory

◆ EnoughAmmoToFire()

virtual bool MoreMountains.CorgiEngine.WeaponAmmo.EnoughAmmoToFire ( )
virtual

◆ FillWeaponWithAmmo()

virtual void MoreMountains.CorgiEngine.WeaponAmmo.FillWeaponWithAmmo ( )
virtual

◆ LoadOnStart()

virtual void MoreMountains.CorgiEngine.WeaponAmmo.LoadOnStart ( )
protectedvirtual

◆ OnDestroy()

void MoreMountains.CorgiEngine.WeaponAmmo.OnDestroy ( )
protected

◆ OnDisable()

virtual void MoreMountains.CorgiEngine.WeaponAmmo.OnDisable ( )
protectedvirtual

On disable, we stop listening for MMGameEvents. You may want to extend that to stop listening to other types of events.

◆ OnEnable()

virtual void MoreMountains.CorgiEngine.WeaponAmmo.OnEnable ( )
protectedvirtual

On enable, we start listening for MMGameEvents. You may want to extend that to listen to other types of events.

◆ OnMMEvent() [1/3]

virtual void MoreMountains.CorgiEngine.WeaponAmmo.OnMMEvent ( MMGameEvent  gameEvent)
virtual

Grabs inventory events and refreshes ammo if needed

Parameters
inventoryEvent

◆ OnMMEvent() [2/3]

virtual void MoreMountains.CorgiEngine.WeaponAmmo.OnMMEvent ( MMInventoryEvent  inventoryEvent)
virtual

On pick we refresh our ammo if needed

Parameters
inventoryEvent

◆ OnMMEvent() [3/3]

virtual void MoreMountains.CorgiEngine.WeaponAmmo.OnMMEvent ( MMStateChangeEvent< MoreMountains.CorgiEngine.Weapon.WeaponStates weaponEvent)
virtual

◆ RefreshCurrentAmmoAvailable()

virtual void MoreMountains.CorgiEngine.WeaponAmmo.RefreshCurrentAmmoAvailable ( )
protectedvirtual

◆ Start()

virtual void MoreMountains.CorgiEngine.WeaponAmmo.Start ( )
protectedvirtual

Member Data Documentation

◆ _ammoItem

InventoryItem MoreMountains.CorgiEngine.WeaponAmmo._ammoItem
protected

◆ _emptied

bool MoreMountains.CorgiEngine.WeaponAmmo._emptied = false
protected

◆ _weapon

Weapon MoreMountains.CorgiEngine.WeaponAmmo._weapon
protected

◆ AmmoID

string MoreMountains.CorgiEngine.WeaponAmmo.AmmoID

the AmmoID that matches the one on the ammo this weapon should use

◆ AmmoInventoryName

string MoreMountains.CorgiEngine.WeaponAmmo.AmmoInventoryName = "MainInventory"

the name of the inventory where the system should look for ammo

◆ CurrentAmmoAvailable

int MoreMountains.CorgiEngine.WeaponAmmo.CurrentAmmoAvailable

the current amount of ammo available in the inventory

◆ MaxAmmo

int MoreMountains.CorgiEngine.WeaponAmmo.MaxAmmo = 100

the theoretical maximum of ammo

◆ ShouldEmptyOnSave

bool MoreMountains.CorgiEngine.WeaponAmmo.ShouldEmptyOnSave = true

if this is true, everytime you equip this weapon, it'll auto fill with ammo

◆ ShouldLoadOnStart

bool MoreMountains.CorgiEngine.WeaponAmmo.ShouldLoadOnStart = true

if this is true, everytime you equip this weapon, it'll auto fill with ammo

Property Documentation

◆ AmmoInventory

Inventory MoreMountains.CorgiEngine.WeaponAmmo.AmmoInventory
getset

The documentation for this class was generated from the following file: