public RangedAttack(AttackSource source, int attackRange, Size projectileSize, int projectileSpeed) : base(source, attackRange) { this.projectileSize = projectileSize; this.projectileSpeed = projectileSpeed; }
public static TerrorismDataPoint LoadFromSource(string rawLine) { List <string> splitLine = RegexParser.SplitCSV(rawLine); string latString = splitLine[13]; string longString = splitLine[14]; string yearString = splitLine[1]; string monthString = splitLine[2]; string dayString = splitLine[3]; string deathsString = splitLine[98]; string logisticalString = splitLine[133]; AttackSource attackSource = GetAttackSourceFromString(logisticalString); int year = Convert.ToInt32(yearString); int month = Convert.ToInt32(monthString); if (month == 0) { month = 1; } int day = Convert.ToInt32(dayString); if (day == 0) { day = 1; } DateTime time = new DateTime(year, month, day); return(new TerrorismDataPoint(latString, longString, deathsString, attackSource, time)); }
public FlyAttack(Actor self, AttackSource source, Target target, bool forceAttack, Color?targetLineColor) { this.source = source; this.target = target; this.forceAttack = forceAttack; this.targetLineColor = targetLineColor; aircraft = self.Trait <Aircraft>(); attackAircraft = self.Trait <AttackAircraft>(); rearmable = self.TraitOrDefault <Rearmable>(); strafeDistance = attackAircraft.Info.StrafeRunLength; // The target may become hidden between the initial order request and the first tick (e.g. if queued) // Moving to any position (even if quite stale) is still better than immediately giving up if ((target.Type == TargetType.Actor && target.Actor.CanBeViewedByPlayer(self.Owner)) || target.Type == TargetType.FrozenActor || target.Type == TargetType.Terrain) { lastVisibleTarget = Target.FromPos(target.CenterPosition); lastVisibleMaximumRange = attackAircraft.GetMaximumRangeVersusTarget(target); if (target.Type == TargetType.Actor) { lastVisibleOwner = target.Actor.Owner; lastVisibleTargetTypes = target.Actor.GetEnabledTargetTypes(); } else if (target.Type == TargetType.FrozenActor) { lastVisibleOwner = target.FrozenActor.Owner; lastVisibleTargetTypes = target.FrozenActor.TargetTypes; } } }
public EquippableTickInfo( bool inputPrimaryOn, bool inputPrimaryWasOn, bool inputSecondaryOn, bool inputSecondaryWasOn, AttackSource atkSource) { primaryOn = inputPrimaryOn; primaryWasOn = inputPrimaryWasOn; secondaryOn = inputSecondaryOn; secondaryWasOn = inputSecondaryWasOn; src = atkSource; }
private Projectile(AttackSource source, int distance, Location location, Size size, string sourceName, Environment map, Movement movement, IAnimation animation) { this.Movement = movement; this.source = source; this.distance = distance; this.Location = location; this.startingLoc = location; this.Size = size; this.Name = "Projectile of " + sourceName; this.map = map; this.Animation = animation; }
public static TerrorismDataPoint FromXml(XmlElement node) { string latString = node.SelectSingleNode(XmlLatNodeName).InnerText; string longString = node.SelectSingleNode(XmlLongNodeName).InnerText; string deathsString = node.SelectSingleNode(XmlDeathsNodeName).InnerText; string domesticString = node.SelectSingleNode(XmlDeathsNodeName).InnerText; string timeTicks = node.SelectSingleNode(XmlDateNodeName).InnerText; string attackSourceString = node.SelectSingleNode(XmlAttackSourceNodeName).InnerText; long ticks = Convert.ToInt64(timeTicks); DateTime time = new DateTime(ticks); AttackSource attackSource = (AttackSource)Convert.ToInt32(attackSourceString); return(new TerrorismDataPoint(latString, longString, deathsString, attackSource, time)); }
private static float ToAttackSourceWeight(AttackSource attackSource) { switch (attackSource) { case AttackSource.International: return(1); case AttackSource.Domestic: return(0); case AttackSource.Unknown: default: return(.5f); } }
public TerrorismDataPoint(string latString, string longString, string deathsString, AttackSource attackSource, DateTime time) { if (latString == "" || longString == "") { return; } Lat = Convert.ToSingle(latString); Long = Convert.ToSingle(longString); AttackSource = attackSource; if (deathsString != "") { Deaths = Convert.ToInt32(deathsString); } Time = time; }
public void AttackTarget(Target target, AttackSource source, bool queued, bool allowMove, bool forceAttack = false, Color?targetLineColor = null) { if (IsTraitDisabled) { return; } if (!target.IsValidFor(self)) { return; } var activity = GetAttackActivity(self, source, target, allowMove, forceAttack, targetLineColor); self.QueueActivity(queued, activity); OnResolveAttackOrder(self, activity, target, queued, forceAttack); }
public Projectile(AttackSource source, int distance, Location location, Size size, string sourceName, Environment map, int speed, Location vector, IAnimation animation) : this(source, distance, location, size, sourceName, map, new StrightMovement(speed, vector), animation) { if (vector.x < 0) { dirs.Add(Direction.up); } else if (vector.x > 0) { dirs.Add(Direction.down); } if (vector.y < 0) { dirs.Add(Direction.right); } else if (vector.y > 0) { dirs.Add(Direction.left); } }
// Applies damage added with nature of source. public void Apply(AttackSource source, float effectiveness) { Damage damage = new Damage(source.Nature, Min, Max) { Type = Type }; damage.Mul(effectiveness); source.Deals.Add(damage); }
public FlyAttack(Actor self, AttackSource source, in Target target, bool forceAttack, Color?targetLineColor)
public override Activity GetAttackActivity(Actor self, AttackSource source, Target newTarget, bool allowMove, bool forceAttack, Color?targetLineColor) { return(new AttackTDGunboatTurretedActivity(self, newTarget, allowMove, forceAttack, targetLineColor)); }
public abstract Activity GetAttackActivity(Actor self, AttackSource source, Target newTarget, bool allowMove, bool forceAttack, Color?targetLineColor = null);
public override void _PhysicsProcess(float delta) { if (Main.i.gameInputActive) { _input.ReadGodotInputs(); } else { _input.Clear(); } _fpsCtrl.ProcessMovement(_input, delta); //Main.i.SetDebugText(_fpsCtrl.debugStr); if (_input.isBitOn(FPSInput.BitNextSlot)) { _inventory.SelectNextWeapon(); } if (_input.isBitOn(FPSInput.BitPrevSlot)) { _inventory.SelectPrevWeapon(); } if (_input.isBitOn(FPSInput.BitSlot1)) { _inventory.SelectWeaponByIndex(0); } if (_input.isBitOn(FPSInput.BitSlot2)) { _inventory.SelectWeaponByIndex(1); } if (_input.isBitOn(FPSInput.BitSlot3)) { _inventory.SelectWeaponByIndex(2); } if (_input.isBitOn(FPSInput.BitSlot4)) { _inventory.SelectWeaponByIndex(3); } if (_input.isBitOn(FPSInput.BitSlot5)) { _inventory.SelectWeaponByIndex(4); } if (_input.isBitOn(FPSInput.BitSlot6)) { _inventory.SelectWeaponByIndex(5); } if (_input.isBitOn(FPSInput.BitSlot7)) { _inventory.SelectWeaponByIndex(6); } if (_input.isBitOn(FPSInput.BitSlot8)) { _inventory.SelectWeaponByIndex(7); } AttackSource src = new AttackSource(); src.team = GetTeam(); src.ignoreBody = _body; src.actorId = _entId; bool secondaryOnToggled = _input.hasBitToggledOn(FPSInput.BitAttack2); EquippableTickInfo info = new EquippableTickInfo( _input.isBitOn(FPSInput.BitAttack1), _input.hasBitToggledOn(FPSInput.BitAttack1), _input.isBitOn(FPSInput.BitAttack2), _input.hasBitToggledOn(FPSInput.BitAttack2), src); _inventory.Tick(delta, info); _inventory.FillHudStatus(_hudState); _hudState.health = _health; if (_viewModel != null) { _viewModel.SetViewModelState(_hudState.view); } Main.i.ui.SetHudState(_hudState); }
public override Activity GetAttackActivity(Actor self, AttackSource source, Target newTarget, bool allowMove, bool forceAttack, Color?targetLineColor) { throw new NotImplementedException("AttackBomber requires a scripted target"); }
public override Activity GetAttackActivity(Actor self, AttackSource source, in Target newTarget, bool allowMove, bool forceAttack, Color?targetLineColor)
public void Fire(AttackSource src) { Console.WriteLine($"Melee weapon fire"); _source = src; On(); }
public Attack(AttackSource source, int attackRange) { this.source = source; this.attackRange = attackRange; }
public override Activity GetAttackActivity(Actor self, AttackSource source, Target newTarget, bool allowMove, bool forceAttack, Color?targetLineColor) { return(new InfectRV(self, newTarget, this, info, targetLineColor)); }
public Projectile(AttackSource source, int distance, Location location, Size size, string sourceName, Environment map, int speed, Direction direction, IAnimation animation) : this(source, distance, location, size, sourceName, map, new StrightMovement(speed, direction), animation) { dirs.Add(direction); }
public override Activity GetAttackActivity(Actor self, AttackSource source, Target newTarget, bool allowMove, bool forceAttack, Color?targetLineColor = null) { return(new FlyAttack(self, source, newTarget, forceAttack, targetLineColor)); }
protected AttackUnit(int experience, int health, int armor, int initiative, int chanceToHit, Target targetType, AttackSource attackSource, int damage) : base(experience, health, armor, initiative, chanceToHit, targetType, attackSource) { this.Damage = damage; }
public override Activity GetAttackActivity(Actor self, AttackSource source, Target newTarget, bool allowMove, bool forceAttack, Color?targetLineColor) { return(new SwallowTarget(self, newTarget, allowMove, forceAttack)); }
public override void FirePrimary(AttackSource src) { base.FirePrimary(src); }
protected Unit(int experience, int health, int armor, int initiative, int chanceToHit, Target targetType, AttackSource attackSource) { this.Experience = experience; this.Health = health; this.Armor = armor; this.Initiative = initiative; this.ChanceToHit = chanceToHit; this.TargetType = targetType; this.AttackSource = attackSource; this.IsAlive = true; }
public MeleeAttack(AttackSource source, int attackRange) : base(source, attackRange) { }