public WeaponBehaviour(Transform[] muzzles, GameObject bulletPrefab, IWeaponData data, IInput <bool> input, IAudioGraphicBehaviourController <bool> controller) : base(input, controller) { weaponData = data; this.muzzles = muzzles; this.bulletPrefab = bulletPrefab; }
void Start() { weaponData = GameObject.FindGameObjectWithTag("Controller").GetComponent <IWeaponData>(); dataManager = GameObject.FindGameObjectWithTag("Controller").GetComponent <DataManager>(); bulletsLenth = bullets.Count; bulletLevel = 1; GameController.OnStart += ReInit; }
public WeaponReplication(IWeaponData weaponData, ICustomCastObject castObject) : base(castObject) { _weaponData = weaponData; weaponData.DamageUpdated += OnDamageUpdated; _getterDic.Add(nameof(_weaponData.Id), () => _weaponData.Id); _setterDic.Add(nameof(_weaponData.Id), obj => _weaponData.Id = _castObject.To <string>(obj)); _getterDic.Add(nameof(_weaponData.Damage), () => _weaponData.Damage); _setterDic.Add(nameof(_weaponData.Damage), obj => _weaponData.Damage = _castObject.To <uint>(obj)); }
/// <summary> /// Constructs a StandardWeapon instance. /// </summary> /// <param name="owner">Reference to the entity that this standard weapon belongs to.</param> /// <param name="weaponData">The definition of the weapon from the metadata.</param> public StandardWeapon(Entity owner, IWeaponData weaponData) : base(owner, weaponData.Missiles) { if (weaponData == null) { throw new ArgumentNullException("weaponData"); } this.weaponData = weaponData; this.frameIndexOfLastLaunch = this.ConstructField <int>("frameIndexOfLastLaunch"); this.frameIndexOfLastLaunch.Write(-1); }
/// <summary> /// Constructs a CustomWeaponStub instance. /// </summary> /// <param name="owner">Reference to the entity that this custom weapon stub belongs to.</param> /// <param name="weaponData">The definition of the weapon from the metadata.</param> internal CustomWeaponStub(Entity owner, IWeaponData weaponData) : base(owner, weaponData.Missiles) { if (weaponData == null) { throw new ArgumentNullException("weaponData"); } this.weaponData = weaponData; this.attachedWeapon = this.ConstructField <CustomWeapon>("attachedWeapon"); this.attachedWeapon.Write(null); }
static partial void FillBinaryFlags2Custom(MutagenFrame frame, IWeaponData item) { var flags2 = frame.ReadUInt32(); flags2 <<= UpperFlagShift; // Clean existing flags var flags = (uint)item.Flags; flags &= ~UpperFlagMask; flags |= flags2; item.Flags = (WeaponData.Flag)flags; }
private IWeapon SearchItem(EWeaponType weaponType, ref List <IWeaponData> weaponsData) { var searched = from currentData in weaponsData where currentData.Weapon.WeaponInfo.WeaponType == weaponType select currentData; if (searched != null && searched.Count() >= 1) { IWeaponData data = searched.FirstOrDefault(); weaponsData.Remove(data); return(data.Weapon); } else { throw new Exception("Invertory structure is incorrect!"); } }
/// <summary> /// Constructs a WeaponDataUpgrade instance. /// </summary> /// <param name="metadataUpgrade">The metadata upgrade that this instance belongs to.</param> /// <param name="originalWeaponData">The original weapon data that this instance is upgrading.</param> public WeaponDataUpgrade(ScenarioMetadataUpgrade metadataUpgrade, IWeaponData originalWeaponData) { if (metadataUpgrade == null) { throw new ArgumentNullException("metadataUpgrade"); } if (originalWeaponData == null) { throw new ArgumentNullException("originalWeaponData"); } this.metadataUpgrade = metadataUpgrade; this.missileDataWrappers = new List <MissileDataWrapper>(); this.damageModifier = new IntValueModifier(); this.cooldownModifier = new IntValueModifier(); this.rangeMaxModifier = new IntValueModifier(); this.rangeMinModifier = new IntValueModifier(); this.Reset(originalWeaponData); }
/// <summary> /// Resets this instance. /// </summary> /// <param name="originalWeaponData">The original weapon data that this instance is upgrading.</param> internal void Reset(IWeaponData originalWeaponData) { if (originalWeaponData == null) { throw new ArgumentNullException("originalWeaponData"); } this.originalWeaponData = originalWeaponData; this.originalUpdateIface = originalWeaponData as IWeaponDataUpgrade; this.damageModifier.AttachModifiedValue(this.originalWeaponData.Damage); this.cooldownModifier.AttachModifiedValue(this.originalWeaponData.Cooldown); this.rangeMaxModifier.AttachModifiedValue(this.originalWeaponData.RangeMax); this.rangeMinModifier.AttachModifiedValue(this.originalWeaponData.RangeMin); this.missileDataWrappers.Clear(); foreach (IMissileData originalMissileData in this.originalWeaponData.Missiles) { this.missileDataWrappers.Add(new MissileDataWrapper(this, originalMissileData)); } }
public WeaponModel(IWeaponData data) { _data = data; }
public HomeController() { db = new InMemoryWeaponData(); }
public DisplayByIdModel(ICitizenData citizenData, IWeaponData weaponData) { _citizenData = citizenData; _weaponData = weaponData; }
static partial void FillBinaryFlagsCustom(MutagenFrame frame, IWeaponData item) { // Read normally item.Flags = (WeaponData.Flag)frame.ReadUInt16(); }
void Start() { scoreData = GameObject.FindGameObjectWithTag("Controller").GetComponent <IScoreData>(); weaponData = GameObject.FindGameObjectWithTag("Controller").GetComponent <IWeaponData>(); GameController.OnGameOver += Init; }
public CreateModel(ICitizenData citizenData, IWeaponData weaponData) { _citizenData = citizenData; _weaponData = weaponData; }