public override void SerializeEffect <T>(T effect) { base.SerializeEffect(effect); var comp = effect as ImbueWeapon; Imbue_Slot = comp.AffectSlot; }
public override void SerializeEffect <T>(T component) { var comp = component as ImbueEffectCondition; AnyImbue = comp.AnyImbue; WeaponToCheck = comp.WeaponToCheck; ImbuePresetID = comp.ImbueEffectPreset?.PresetID ?? -1; }
public WeaponInformation(string name, int clipSize, int clipCount, float firerate, float reloadTime, int mobility, Weapon.AmmoTyp ammoType, Weapon.WeaponSlot slot, Weapon.EquipmentType equipType, string projectileName) { Name = name; Slot = slot; Firerate = firerate; ClipCount = clipCount; ClipSize = clipSize; ReloadTime = reloadTime; AmmoType = ammoType; EquipmentType = equipType; ProjectileName = projectileName; Mobility = mobility; }
protected bool SwitchWeapon(Weapon.WeaponSlot slot) { Weapon preInHand = inHand; bool success = false; switch (slot) { case Weapon.WeaponSlot.Primary: if (primaryWeapon != null) { inHand = primaryWeapon; success = true; } break; case Weapon.WeaponSlot.Secondary: if (secondaryWeapon != null) { inHand = secondaryWeapon; success = true; } break; case Weapon.WeaponSlot.FragGrenade: if (fragGrenade != null) { inHand = fragGrenade; success = true; } break; case Weapon.WeaponSlot.FlashBang: if (flashbang != null) { inHand = flashbang; success = true; } break; case Weapon.WeaponSlot.None: success = false; break; } if (preInHand != null && preInHand != inHand && success) { preInHand.AbortReload(); } return(success); }
public override void SerializeEffect <T>(T component) { var comp = component as ImbueEffectORCondition; AnyImbue = comp.AnyImbue; WeaponToCheck = comp.WeaponToCheck; if (comp.ImbueEffectPresets != null) { ImbuePresetIDs = new List <int>(); foreach (var imbue in comp.ImbueEffectPresets) { ImbuePresetIDs.Add(imbue.PresetID); } } }
// Only a helmet can go into this slot public override Item SwapItem(Item i = null) { Item temp = HeldItem; Weapon WTemp = null; if (i != null) { WTemp = i.GetComponent <Weapon>(); } else { HeldItem = i; SetHeldItem(); UpdateItemDisplay(); } if (WTemp != null) { Weapon.WeaponSlot wSlot = WTemp.GetSlot(); if (WTemp.GetSlot() == Weapon.WeaponSlot.Gauntlets || WTemp.GetSlot() == Weapon.WeaponSlot.All) { HeldItem = i; SetHeldItem(); UpdateItemDisplay(); } else { temp = i; } } else { temp = i; } if (HeldItem != null) { Durability = HeldItem.durability; } else { Durability = 100; } SetDurability(Durability); return(temp); }
public void PickupWeapon(Weapon weapon, Weapon.WeaponSlot slot) { if (weapon == null || slot == Weapon.WeaponSlot.None) { return; } weapon.Init(this, teamId); switch (slot) { case Weapon.WeaponSlot.Primary: if (inHand == primaryWeapon) { inHand = weapon; } primaryWeapon = weapon; break; case Weapon.WeaponSlot.Secondary: if (inHand == secondaryWeapon) { inHand = weapon; } secondaryWeapon = weapon; break; case Weapon.WeaponSlot.FragGrenade: if (inHand == fragGrenade) { inHand = weapon; } fragGrenade = weapon; break; case Weapon.WeaponSlot.FlashBang: if (inHand == flashbang) { inHand = weapon; } flashbang = weapon; break; } }
public static void equipOn(Actor targetActor, Weapon.WeaponSlot slot, Weapon targetWeapon) { int targetSlot = (int)slot; //check for compatability if (targetWeapon.weaponSlot != slot) { Console.WriteLine("This doesn't go here!"); return; } if (targetActor.WeaponSlotsArray[targetSlot] != null) //unequip existing item { Inventory.Add(targetActor.WeaponSlotsArray[targetSlot]); Console.WriteLine(targetActor.WeaponSlotsArray[targetSlot].name + " has been returned to Inventory."); } targetActor.WeaponSlotsArray[targetSlot] = targetWeapon; if (FirstTimeBow < 3 && targetWeapon.isBow() && !targetActor.isArrowsEquipped()) //remind new player to equip arrows with bow { Console.WriteLine("I'm going to need arrows to use this..."); FirstTimeBow++; } Inventory.Remove(targetWeapon); }
public override void SerializeEffect <T>(T effect) { AffectSlot = (effect as RemoveImbueEffects).AffectSlot; }
public override void SerializeEffect <T>(T effect, DM_Effect holder) { base.SerializeEffect(effect, holder); Imbue_Slot = (effect as ImbueWeapon).AffectSlot; }
public override void SerializeEffect <T>(T effect) { WeaponSlot = (effect as UnloadWeapon).WeaponSlot; }