public Storyline() { _combat = new Combat(); _traveler = new Traveler(); _agentInteraction = new AgentInteraction(); _agentBlacklist = new List<long>(); _storylines = new Dictionary<string, IStoryline>(); //_storylines.Add("__", new GenericCombatStoryline()); //_storylines.Add("Materials For War Preparation", new MaterialsForWarPreparation()); _storylines.Add("Shipyard Theft", new GenericCombatStoryline()); _storylines.Add("Evolution", new GenericCombatStoryline()); _storylines.Add("Record Cleaning", new GenericCombatStoryline()); _storylines.Add("Covering Your Tracks", new GenericCombatStoryline()); _storylines.Add("Crowd Control", new GenericCombatStoryline()); _storylines.Add("A Force to Be Reckoned With", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - Ambush In The Dark (1 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - The Kidnapping (3 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - Incriminating Evidence (5 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - The Secret Meeting (7 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - Defend the Civilian Convoy (8 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - Retrieve the Prisoners (9 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - The Final Battle (10 of 10)", new GenericCombatStoryline()); _storylines.Add("Whispers in the Dark - First Contact (1 of 4)", new GenericCombatStoryline()); _storylines.Add("Whispers in the Dark - Lay and Pray (2 of 4)", new GenericCombatStoryline()); _storylines.Add("Whispers in the Dark - The Outpost (4 of 4)", new GenericCombatStoryline()); _storylines.Add("Transaction Data Delivery", new TransactionDataDelivery()); _storylines.Add("Innocents in the Crossfire", new TransactionDataDelivery()); }
public override void Run(Combat.Character character) { Int32 explod_id = EvaluationHelper.AsInt32(character, Id, Int32.MinValue); Int32 time = EvaluationHelper.AsInt32(character, Time, 1); foreach (Combat.Explod explod in character.GetExplods(explod_id)) explod.Data.BindTime = time; }
public override void init() { combatData = gameObject.GetComponent<Combat>(); movement = gameObject.GetComponent<Navigation>(); ai = GetComponent<HasObjectivePath>(); }
public override void Run(Combat.Character character) { Single x = EvaluationHelper.AsSingle(character, X, 0); Single y = EvaluationHelper.AsSingle(character, Y, 0); character.CurrentVelocity += new Vector2(x, y); }
public override void Run(Combat.Character character) { Int32 animationnumber = EvaluationHelper.AsInt32(character, AnimationNumber, 0); Boolean drawunder = EvaluationHelper.AsBoolean(character, DrawUnder, false); Point offset = EvaluationHelper.AsPoint(character, DrawPosition, new Point(0, 0)); Int32 randomdisplacement = EvaluationHelper.AsInt32(character, RandomDisplacement, 0); Combat.ExplodData data = new xnaMugen.Combat.ExplodData(); data.Scale = Vector2.One; data.AnimationNumber = animationnumber; data.CommonAnimation = true; data.Location = (Vector2)offset; data.PositionType = PositionType.P1; data.RemoveTime = -2; data.DrawOnTop = false; data.OwnPalFx = true; data.SpritePriority = (drawunder == true) ? -9 : 9; data.Random = new Point(randomdisplacement / 2, randomdisplacement / 2); data.Transparency = new Blending(); data.Creator = character; data.Offseter = character; Combat.Explod explod = new Combat.Explod(character.Engine, data); if (explod.IsValid == true) explod.Engine.Entities.Add(explod); }
public override void Run(Combat.Character character) { Int32 time = EvaluationHelper.AsInt32(character, Time, 1); Int32 target_id = EvaluationHelper.AsInt32(character, TargetId, Int32.MinValue); Vector2 offset = EvaluationHelper.AsVector2(character, Position, new Vector2(0, 0)); foreach (Combat.Character target in character.GetTargets(target_id)) { switch (BindPosition) { case BindToTargetPostion.Mid: offset += target.BasePlayer.Constants.Midposition; break; case BindToTargetPostion.Head: offset += target.BasePlayer.Constants.Headposition; break; case BindToTargetPostion.None: case BindToTargetPostion.Foot: default: break; } character.Bind.Set(target, offset, time, 0, false); break; } }
public override void Draw(Combat.PaletteFx palettefx) { Point tilestart; Point tileend; GetTileLength(Sprite.Size, out tilestart, out tileend); Video.DrawState drawstate = SpriteManager.DrawState; drawstate.Reset(); drawstate.Blending = Transparency; drawstate.ScissorRectangle = DrawRect; drawstate.Set(Sprite); for (Int32 y = tilestart.Y; y != tileend.Y; ++y) { for (Int32 x = tilestart.X; x != tileend.X; ++x) { Vector2 adjustment = (Vector2)(Sprite.Size + TilingSpacing) * new Vector2(x, y); Vector2 location = CurrentLocation + adjustment; drawstate.AddData(location, null); } } if (palettefx != null) palettefx.SetShader(drawstate.ShaderParameters); drawstate.Use(); }
Boolean GetRange(Combat.Character character, out Int32 min, out Int32 max) { if (Range == null) { min = 0; max = 1000; return true; } Evaluation.Number[] result = Range.Evaluate(character); if (result.Length > 0 && result[0].NumberType != NumberType.None) { if (result.Length > 1 && result[1].NumberType != NumberType.None) { min = result[0].IntValue; max = result[1].IntValue; return true; } else { min = 0; max = result[0].IntValue; return true; } } min = 0; max = 1; return false; }
public override void Run(Combat.Character character) { Single x = EvaluationHelper.AsSingle(character, X, 0); Single y = EvaluationHelper.AsSingle(character, Y, 0); character.Move(new Vector2(x, y)); }
public Questor() { _lastPulse = DateTime.MinValue; _random = new Random(); _salvage = new Salvage(); _defense = new Defense(); _combat = new Combat(); _traveler = new Traveler(); _unloadLoot = new UnloadLoot(); _agentInteraction = new AgentInteraction(); _arm = new Arm(); _missionController = new MissionController(); _drones = new Drones(); _panic = new Panic(); _storyline = new Storyline(); Settings.Instance.SettingsLoaded += SettingsLoaded; // State fixed on ExecuteMission State = QuestorState.Idle; _directEve = new DirectEve(); Cache.Instance.DirectEve = _directEve; _directEve.OnFrame += OnFrame; }
public override void Run(Combat.Character character) { Int32? start = EvaluationHelper.AsInt32(character, StartRange, null); Int32? end = EvaluationHelper.AsInt32(character, EndRange, null); if (IntNumber != null) { Int32? value = EvaluationHelper.AsInt32(character, IntNumber, null); if (value != null) { for (Int32 i = 0; i != character.Variables.IntegerVariables.Count; ++i) { if (i < start || i > end) continue; character.Variables.SetInteger(i, false, value.Value); } } } if (FloatNumber != null) { Single? value = EvaluationHelper.AsSingle(character, FloatNumber, null); if (value != null) { for (Int32 i = 0; i != character.Variables.FloatVariables.Count; ++i) { if (i < start || i > end) continue; character.Variables.SetFloat(i, false, value.Value); } } } }
public override void Run(Combat.Character character) { character.OffensiveInfo.MoveContact = 0; character.OffensiveInfo.MoveGuarded = 0; character.OffensiveInfo.MoveHit = 0; character.OffensiveInfo.MoveReversed = 0; }
public override void Run(Combat.Character character) { Int32 spritepriority = EvaluationHelper.AsInt32(character, Priority, 0); spritepriority = Misc.Clamp(spritepriority, -5, 5); character.DrawOrder = spritepriority; }
// Use this for initialization public void Init() { player_combatData = GameObject.Find("player").GetComponent<Combat>(); health = playerHealth.GetComponent<Slider>(); mana = playerMana.GetComponent<Slider>(); init = true; }
public Boolean Trigger(Combat.Character character) { if (character == null) throw new ArgumentNullException("character"); foreach (var trigger in m_triggers) { Boolean ok = true; foreach (Evaluation.Expression exp in trigger.Value) { if(exp.EvaluateFirst(character).BooleanValue == false) { ok = false; break; } } if (ok == true) { if (trigger.Key != 0) return true; } else { if (trigger.Key == 0) return false; } } return false; }
public void changeTarget() { if (player.target == null) return; player_target.SetActive(true); target = player.target.GetComponent<Combat>(); if(TeamLogic.areAllies(target.gameObject, player.gameObject)) { targetHealth.color = new Color(0, 255, 0); } else { targetHealth.color = new Color(255, 0, 0); } /* if(target.maxMana() > 0) { targetMana.color = new Color(0, 0, 255); } else { targetMana.color = new Color(255, 255, 255); } */ }
public Recording(Combat.EngineInitialization init, List<RecordingData> data) { if (init == null) throw new ArgumentNullException("init"); if (data == null) throw new ArgumentNullException("data"); m_initsettings = init; m_data = data; }
public override void Run(Combat.Character character) { Int32? hits = EvaluationHelper.AsInt32(character, Hits, null); if (hits == null || hits <= 0) return; character.Team.Display.ComboCounter.AddHits(hits.Value); }
public override void Run(Combat.Character character) { Single? multiplier = EvaluationHelper.AsSingle(character, Multiplier, null); if (multiplier == null) return; character.DefensiveInfo.DefenseMultiplier = multiplier.Value; }
public override void Run(Combat.Character character) { Int32 explod_id = EvaluationHelper.AsInt32(character, ExplodId, Int32.MinValue); List<Combat.Explod> removelist = new List<Combat.Explod>(character.GetExplods(explod_id)); foreach (Combat.Explod explod in removelist) explod.Kill(); }
public override void Run(Combat.Character character) { Vector3 color = EvaluationHelper.AsVector3(character, ScreenColor, Vector3.One); Int32 time = EvaluationHelper.AsInt32(character, Time, 1); Boolean underflag = EvaluationHelper.AsBoolean(character, Under, false); character.Engine.EnvironmentColor.Setup(color, time, underflag); }
public override void Run(Combat.Character character) { Vector2 velocity = Vector2.Zero; velocity.X = character.DefensiveInfo.HitDef.FallVelocityX ?? character.CurrentVelocity.X; velocity.Y = character.DefensiveInfo.HitDef.FallVelocityY; character.CurrentVelocity = velocity; }
public override void Run(Combat.Character character) { Int32? amount = EvaluationHelper.AsInt32(character, Amount, null); if (amount == null) return; character.Life = amount.Value; }
public Attack(Combat.attackPhase phase, int skill, string damageExpression, bool isAP = false) { this.AttackPhase = phase; this.Skill = skill; this.DamageExpression = damageExpression; this.parseDamageExpression(); this.IsAP = isAP; }
public override void Run(Combat.Character character) { Boolean boundflag = EvaluationHelper.AsBoolean(character, BoundFlag, false); Point movecamera = EvaluationHelper.AsPoint(character, MoveCamera, new Point(0, 0)); character.ScreenBound = boundflag; character.CameraFollowX = movecamera.X > 0; character.CameraFollowY = movecamera.Y > 0; }
public override void Run(Combat.Character character) { Boolean? pushflag = EvaluationHelper.AsBoolean(character, PushFlag, null); if (pushflag != null) { character.PushFlag = pushflag.Value; } }
public override void Run(Combat.Character character) { Int32? distance = EvaluationHelper.AsInt32(character, GuardDistance, null); if (distance != null && character.OffensiveInfo.ActiveHitDef == true) { character.OffensiveInfo.HitDef.GuardDistance = distance.Value; } }
public override void Run(Combat.Character character) { Single angle = EvaluationHelper.AsSingle(character, Angle, character.DrawingAngle); character.DrawingAngle = angle; character.AngleDraw = true; Vector2? scale = EvaluationHelper.AsVector2(character, Scale, null); if (scale != null) character.DrawScale = scale.Value; }
public override void Run(Combat.Character character) { Boolean? control = EvaluationHelper.AsBoolean(character, Control, null); if (control != null) { if (control == true) character.PlayerControl = PlayerControl.InControl; if (control == false) character.PlayerControl = PlayerControl.NoControl; } }
static Boolean InGuardDistance(Combat.HitDefinition hitdef, Combat.Entity attacker, Combat.Character target) { if (attacker == null) throw new ArgumentNullException("attacker"); if (target == null) throw new ArgumentNullException("target"); if (hitdef == null) throw new ArgumentNullException("hitdef"); Single distance = Math.Abs(attacker.CurrentLocation.X - target.CurrentLocation.X); return distance <= hitdef.GuardDistance; }
public JsonResult AcceptSearch(int combatId) { Combat selectedCombat = this.ControllerGame.GetCombat(combatId); if (selectedCombat != null) { string message = null; // Check that it is the current players turn if (selectedCombat.ShipTurn == this.ControllerGame.CurrentPlayer.Ship) { try { selectedCombat.AcceptSearch(); } catch (ArgumentException ex) { // Log this exception ExceptionPolicy.HandleException(ex, "Controller Policy"); // Not enough credits to pay fine. message = ex.Message; } catch (InvalidOperationException ex) { // Log this exception ExceptionPolicy.HandleException(ex, "Controller Policy"); // No search offered? message = ex.Message; } } return(Json(new { message = message, status = BuildCombatStatus(selectedCombat) })); } return(Json(false)); }
public override bool Position(int id, Monster monster, Combat.Mode mode) { if (DistanceTo(id) > monster.HitBox && CanStillAttack(id)) { if (mode == Combat.Mode.Meshing && !Combat.IsPositionSafe(_fface.NPC.PosX(id), _fface.NPC.PosZ(id))) { return(false); } _fface.Navigator.Reset(); _fface.Navigator.DistanceTolerance = monster.HitBox * 0.95; _fface.Navigator.Goto(_fface.NPC.PosX(id), _fface.NPC.PosZ(id), false); } bool wasLocked = true; if (_fface.Player.Zone != Zone.Cape_Teriggan) { var difference = GetSADifference(id); while ((difference < 66 || difference > 89) && _fface.NPC.HPPCurrent(id) > 0) { if (!_fface.Target.IsLocked) { wasLocked = false; _fface.Windower.SendString("/lockon"); } _fface.Windower.SendKey(KeyCode.NP_Number6, true); Thread.Sleep(80); _fface.Windower.SendKey(KeyCode.NP_Number6, false); difference = GetSADifference(id); } if (!wasLocked && _fface.Target.IsLocked) { _fface.Windower.SendString("/lockon"); } } return(true); }
public static void Room(Dungeon d, Creature p, Event[] Event) { foreach (Event e in Event) { int a = e.eventType; switch (a) { case 0: Console.Clear(); Console.WriteLine(""); Monster.opponentList = new List <Monster> { }; Monster.opponentList.Add(d.boss.MonsterCopy()); Combat.Start(p, Monster.opponentList, d); break; case 1: Event1(d, p, e); break; case 2: Event2(d, p, e); break; case 3: Event3(d, p, e); break; case 4: Event4(d, p, e); break; case 5: Event5(d, p, e); break; } } }
//THIS METHOD IS REFERENCED BY THE CHARACTERCONTROLLER AS WELL public IActionResult ShowGame(int id) { //LOGIN CHECK if (HttpContext.Session.GetString("CurUser") == null) { return(RedirectToAction("LoginPage", "Login")); } //FOR USE OF CHARACTERCONTROLLER SETS UP VIEWBAG DATA FOR UPDATE CHARACTER METHOD if (TempData["UpdateToggle"] != null) { ViewBag.UpdateToggle = TempData["UpdateToggle"]; int PlayerId = ViewBag.UpdateToggle; Character UpdateCharacter = _context.character.SingleOrDefault(player => player.CharacterId == PlayerId); ViewBag.UpdateCharacter = UpdateCharacter; } //FOR USE OF CHARACTER CONTROLLER SETS UP VIEWBAG DATA FOR DELETE CHARACTER METHOD if (TempData["ConfirmDeleteCharacter"] != null) { ViewBag.ConfirmDeleteCharacter = TempData["ConfirmDeleteCharacter"]; } //FOR USE OF DICE ROLLER TOGGLE AND DISPLAY MECHANICS ViewBag.rollResult = TempData["rollResult"]; ViewBag.rollerToggle = HttpContext.Session.GetString("rollerToggle"); //PAGE LOAD DB SETUP SAVED TO VIEWBAGS (would have used model binding if there weren't so many forms through partials) //--NOTE: come back to and see if viewbag info/query can be streamlined ViewBag.Id = id; Combat curCombat = _context.combat.Include(fight => fight.Characters).SingleOrDefault(fight => fight.CombatId == id); List <Character> charactersInit = curCombat.Characters.OrderByDescending(person => person.Initiative).ToList(); ViewBag.curCombat = curCombat; ViewBag.charactersInit = charactersInit; ViewBag.numOfPlayers = charactersInit.Count(); return(View("ShowGame")); }
bool blockCheck() { Combat targetCombatScript = target.GetComponent <Combat>(); if (targetCombatScript.blocking == true) { if (targetCombatScript.attackDirection == Combat.directions.left) { if (target.transform.position.x > transform.position.x) { return(true); } else { return(false); } } else if (targetCombatScript.attackDirection == Combat.directions.right) { if (target.transform.position.x < transform.position.x) { return(true); } else { return(false); } } else { return(false); } } else { return(false); } }
public Storyline() { _combat = new Combat(); _traveler = new Traveler(); _agentInteraction = new AgentInteraction(); _agentBlacklist = new List <long>(); _storylines = new Dictionary <string, IStoryline>(); //_storylines.Add("__", new GenericCombatStoryline()); _storylines.Add("Materials For War Preparation", new MaterialsForWarPreparation()); _storylines.Add("Shipyard Theft", new GenericCombatStoryline()); _storylines.Add("Evolution", new GenericCombatStoryline()); _storylines.Add("Record Cleaning", new GenericCombatStoryline()); _storylines.Add("Covering Your Tracks", new GenericCombatStoryline()); _storylines.Add("Crowd Control", new GenericCombatStoryline()); _storylines.Add("A Force to Be Reckoned With", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - Ambush In The Dark (1 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - The Kidnapping (3 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - Incriminating Evidence (5 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - The Secret Meeting (7 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - Defend the Civilian Convoy (8 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - Retrieve the Prisoners (9 of 10)", new GenericCombatStoryline()); _storylines.Add("Kidnappers Strike - The Final Battle (10 of 10)", new GenericCombatStoryline()); _storylines.Add("Whispers in the Dark - First Contact (1 of 4)", new GenericCombatStoryline()); _storylines.Add("Whispers in the Dark - Lay and Pray (2 of 4)", new GenericCombatStoryline()); _storylines.Add("Whispers in the Dark - The Outpost (4 of 4)", new GenericCombatStoryline()); _storylines.Add("Transaction Data Delivery", new TransactionDataDelivery()); _storylines.Add("Innocents in the Crossfire", new GenericCombatStoryline()); _storylines.Add("Patient Zero", new GenericCombatStoryline()); _storylines.Add("Soothe the Salvage Beast", new GenericCombatStoryline()); _storylines.Add("Forgotten Outpost", new GenericCombatStoryline()); _storylines.Add("Stem the Flow", new GenericCombatStoryline()); _storylines.Add("Quota Season", new GenericCombatStoryline()); //why cant we pickup the Custom Circuitry? problem in salvage.cs somewhere: "salvage: Container" name: Number "contained no valuable loot" //_storylines.Add("Matriarch", new GenericCombatStoryline()); //_storylines.Add("Diplomatic Incident", new GenericCombatStoryline()); _storylines.Add("Nine Tenths of the Wormhole", new GenericCombatStoryline()); }
public JsonResult PickupCargo(int combatId) { Combat selectedCombat = this.ControllerGame.GetCombat(combatId); if (selectedCombat != null) { string message = null; // Check that it is the current players turn if (selectedCombat.ShipTurn == this.ControllerGame.CurrentPlayer.Ship) { try { selectedCombat.PickupCargo(); } catch (InvalidOperationException ex) { // Log this exception ExceptionPolicy.HandleException(ex, "Controller Policy"); // Combat is over message = ex.Message; } catch (ArgumentOutOfRangeException ex) { // Log this exception ExceptionPolicy.HandleException(ex, "Controller Policy"); // Not enough turn points message = ex.Message; } } return(Json(new { message = message, status = BuildCombatStatus(selectedCombat) })); } return(Json(false)); }
public bool OnCast(Character caster, string args) { string[] sArgs = args.Split(" ".ToCharArray()); Character target = ReferenceSpell.FindAndConfirmSpellTarget(caster, sArgs[sArgs.Length - 1]); if (target == null) { return(false); } if (!target.IsUndead) { caster.WriteToDisplay("The " + ReferenceSpell.Name + " spell only works on the undead."); return(false); } ReferenceSpell.SendGenericCastMessage(caster, target, true); int totalDamage = (Skills.GetSkillLevel(caster.magic) * ((caster.IsPC ? GameSpell.DEATH_SPELL_MULTIPLICAND_PC : GameSpell.DEATH_SPELL_MULTIPLICAND_NPC) + 1)) + GameSpell.GetSpellDamageModifier(caster); totalDamage += Rules.RollD(1, 2) == 1 ? Rules.RollD(1, 4) : -(Rules.RollD(1, 4)); Item totem = caster.FindHeldItem(Item.ID_BLOODWOOD_TOTEM); if (totem != null && !totem.IsAttunedToOther(caster)) { totalDamage += Rules.RollD(3, 4); } if (Combat.DoSpellDamage(caster, target, null, totalDamage, ReferenceSpell.Name.ToLower()) == 1) { Skills.GiveSkillExp(caster, target, Globals.eSkillType.Magic); Rules.GiveKillExp(caster, target); } return(true); }
public bool OnCast(Character caster, string args) { Character target = ReferenceSpell.FindAndConfirmSpellTarget(caster, args); if (target == null) { return(false); } int modifier = 0; if (caster.IsWisdomCaster) { modifier = Rules.GetFullAbilityStat(caster, Globals.eAbilityStat.Wisdom) - Rules.GetFullAbilityStat(target, Globals.eAbilityStat.Dexterity); } else { modifier = Rules.GetFullAbilityStat(caster, Globals.eAbilityStat.Intelligence) - Rules.GetFullAbilityStat(target, Globals.eAbilityStat.Dexterity); } ReferenceSpell.SendGenericCastMessage(caster, target, true); if (EntityLists.PLANT.Contains(target.entity) || EntityLists.INCORPOREAL.Contains(target.entity) || EntityLists.IsPhysicallyMassive(target)) { ReferenceSpell.SendGenericUnaffectedMessage(caster, target); } else if (Combat.DND_CheckSavingThrow(target, Combat.SavingThrow.PetrificationPolymorph, modifier)) // makes saving throw { ReferenceSpell.SendGenericResistMessages(caster, target); target.EmitSound(ReferenceSpell.SoundFile); } else { ReferenceSpell.SendGenericStrickenMessage(caster, target); Effect.CreateCharacterEffect(Effect.EffectTypes.Ensnare, Skills.GetSkillLevel(caster.magic), target, Rules.RollD(2, 4) + 2, caster); } return(true); }
public void Attack() { Player player1 = this.CreateTestPlayer(); Player player2 = this.CreateTestPlayer(); player1.Ship.Attack(player2.Ship); Combat combat = player1.Ship.InProgressCombat; int weaponFires = 0; int weaponMisses = 0; while (combat.Status == Combat.CombatStatus.Incomplete) { Debug.WriteLine(string.Format("Player 2 Shield {0} Hull: {1}", player2.Ship.DamageShield, player2.Ship.DamageHull)); // Max out turn points for testing player1.Ship.InProgressCombat.TurnPointsLeft = 999; if (!player1.Ship.InProgressCombat.FireWeapon()) { weaponMisses++; } weaponFires++; } Debug.WriteLine(string.Format("Weapon Fires: {0} Misses: {1} Perc: {2}", weaponFires, weaponMisses, (100.0 / weaponFires * weaponMisses))); }
public bool OnCast(Character caster, string args) { Character target = ReferenceSpell.FindAndConfirmSpellTarget(caster, args); if (target == null) { return(false); } ReferenceSpell.SendGenericCastMessage(caster, target, true); if (!Combat.DND_CheckSavingThrow(target, Combat.SavingThrow.Spell, Rules.GetFullAbilityStat(caster, Globals.eAbilityStat.Wisdom - Rules.GetFullAbilityStat(target, Globals.eAbilityStat.Wisdom)))) //if (!Combat.DND_CheckSavingThrow(target, Combat.SavingThrow.Spell, 0)) { Effect.CreateCharacterEffect(Effect.EffectTypes.Cynosure, Skills.GetSkillLevel(caster.magic) / 2, target, Skills.GetSkillLevel(caster.magic) * 10, caster); ReferenceSpell.SendGenericStrickenMessage(caster, target); } else { ReferenceSpell.SendGenericResistMessages(caster, target); } return(true); }
private void PerformAttackContinue() { if (Selection.ThisShip != null) { GenericShip targetForAttack = SelectTargetForAttack(); Selection.ThisShip.CallAfterAttackWindow(); Selection.ThisShip.IsAttackPerformed = true; if (targetForAttack != null) { Console.Write("Ship attacks target\n", LogTypes.AI, true, "yellow"); Selection.TryToChangeAnotherShip("ShipId:" + targetForAttack.ShipId); Combat.TryPerformAttack(isSilent: true); } else { Console.Write("Attack is skipped\n", LogTypes.AI, true, "yellow"); OnTargetNotLegalForAttack(); } } }
public override int GetHashCode() { int hash = 1; if (typeCase_ == TypeOneofCase.Swish) { hash ^= Swish.GetHashCode(); } if (typeCase_ == TypeOneofCase.Combat) { hash ^= Combat.GetHashCode(); } if (typeCase_ == TypeOneofCase.Portkey) { hash ^= Portkey.GetHashCode(); } hash ^= (int)typeCase_; if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public CrossGate(Memo memo) : base(memo) { Actions = new Actions(memo); Cheater = new Cheater(memo); Player = new Player(memo); Stuffs = new StuffList(memo); Combat = new Combat(this); AutoCure = new AutoCure(this); Contacts = new ContactList(memo); Pets = new PetList(memo); Items = new ItemList(this); AutoFood = new AutoFood(this); AutoNurse = new AutoNurse(this); PetCatch = new PetCatch(this); Producer = new Producer(this); AutoCombat = new AutoCombat(this); AutoWalk = new AutoWalk(this); Script = Script.GetNewTownInstance(this); Poster = new Poster(this); AutoChange = new AutoChange(this); Cheater.YiDongJiaSu = true; }
public override void initialize_action(int distance) { Battler_1 = Global.game_map.units[Global.game_system.Battler_1_Id]; Battler_2 = Global.game_map.units[Global.game_system.Battler_2_Id]; Battler_1.preload_animations(distance); Battler_2.preload_animations(distance); Combat.battle_setup(Battler_1.id, Battler_2.id, distance, 0); new_combat_data(distance); Reverse = Battler_2.is_opposition; Real_Distance = Distance = distance; //if (Global.data_weapons[Combat_Data.Weapon_1_Id].Max_Range <= 2 && Distance > 2) if (!Global.data_weapons[weapon_id(1)].Long_Range && Distance > 2) //Debug { Distance = 2; } if (Distance == 2) { Pan_Vector = Effects_Pan_Vector = new Vector2(16 * (Reverse ? -1 : 1), 0); } Can_Skip = false; }
void Start() { SetApplicationParameters(); InitializeScripts(); //Global.Initialize(); Phases.Initialize(); Board.Initialize(); Roster.Initialize(); Roster.Start(); Selection.Initialize(); BombsManager.Initialize(); Actions.Initialize(); Combat.Initialize(); Triggers.Initialize(); DamageDecks.Initialize(); new ObstaclesManager(); CheckRemoteSettings(); GameMode.CurrentGameMode.StartBattle(); }
private void DoSecondAttack(object sender, System.EventArgs e) { if (!HostShip.IsCannotAttackSecondTime) { Messages.ShowInfo(HostShip.PilotName + " can perform second attack\nfrom primary weapon"); HostShip.IsCannotAttackSecondTime = true; HostShip.AfterGenerateAvailableActionEffectsList += AddLukeSkywalkerCrewAbility; Phases.OnCombatPhaseEnd += RemoveLukeSkywalkerCrewAbility; Combat.StartAdditionalAttack( HostShip, FinishAdditionalAttack, IsPrimaryWeaponShot ); } else { Messages.ShowErrorToHuman(string.Format("{0} cannot attack one more time", HostShip.PilotName)); Triggers.FinishTrigger(); } }
private void DoExtraPrimaryTurretAttack(object sender, System.EventArgs e) { Messages.ShowInfo(HostUpgrade.UpgradeInfo.Name + "'s bonus attack"); HostShip.IsCannotAttackSecondTime = true; Combat.StartSelectAttackTarget( HostShip, delegate { Selection.ThisShip.IsAttackPerformed = true; //if bonus attack was skipped, allow bonus attacks again if (Selection.ThisShip.IsAttackSkipped) { Selection.ThisShip.IsCannotAttackSecondTime = false; } Triggers.FinishTrigger(); }, IsPrimaryTurretAttack, HostUpgrade.UpgradeInfo.Name, "You may perform an bonus attack from your primary turret arc", HostUpgrade ); }
void LoadPlayer() { PlayerData data = SaveSystem.LoadPlayer(); Combat player = GetComponent <Combat>(); Movement movement = GetComponent <Movement>(); if (data == null) { return; } Vector3 position; position.x = data.position[0]; position.y = data.position[1]; position.z = data.position[2]; transform.position = position; player.currentHealth = (int)data.currentHealth; player.maxHealth = (int)data.maxHealth; movement.stamina = data.currentStamina; movement.maxStamina = data.maxStamina; }
private void PreventDamageBlockerWillDealToAttacker(TargetingRuleParameters p, DamageSourceAndDamageTargetCandidates selectedCandidates) { var blockerAttackerPair = p.Candidates <Card>(selectorIndex: 1, selector: trgs => trgs.Effect) .Where(x => x.IsAttacker) .Select(x => new { Target = x, Source = QuickCombat.GetBlockerThatDealsLeathalDamageToAttacker( attacker: x, blockers: Combat.GetBlockers(x.Card())) }) .Where(x => x.Source != null) .OrderByDescending(x => x.Target.Score) .FirstOrDefault(); if (blockerAttackerPair != null) { selectedCandidates.DamageTarget.Add(blockerAttackerPair.Target); selectedCandidates.DamageSource.Add(blockerAttackerPair.Source); } }
void OnTriggerEnter(Collider col) { // If Bullet Collides With Obstacle | Destroy Bullet | Show Explosion if (col.tag == "Obstacle" || col.tag == "SpeedupCube") { Destroy(gameObject); CmdTriggerExplosion(); } // If Bullet Hits Another Player | Destroy Bullet | Hurt Player | Show Explosion if (col.tag == "Player") { var hit = col.gameObject; var hitPlayer = hit.GetComponent <PlayerMove> (); if (hitPlayer != null) { Destroy(gameObject); Combat combat = hit.GetComponent <Combat> (); combat.TakeDamage(50); } } }
public void SimulateAttack_10Vs07_AreEqual() { var runs = 100000; var rnd = new MT19937Generator(17); var actAtt = new double[runs]; var actDef = new double[runs]; var actRes = new bool[runs]; for (var i = 0; i < runs; i++) { int att; int def; actRes[i] = Combat.SimulateAttack(10, 7, rnd, out att, out def); actAtt[i] = (double)att; actDef[i] = (double)def; } Assert.AreEqual(38039, actRes.Count(item => item), "results"); Assert.AreEqual(4.900, actAtt.Average(), 0.01, "attackers"); Assert.AreEqual(5.990, actDef.Average(), 0.01, "defenders"); }
public void Initialise(PlayerReader playerReader, RequirementFactory requirementFactory, ILogger logger) { Pull.Initialise(playerReader, requirementFactory, logger); Combat.Initialise(playerReader, requirementFactory, logger); Adhoc.Initialise(playerReader, requirementFactory, logger); Parallel.Initialise(playerReader, requirementFactory, logger); ShapeshiftForm.ForEach(i => i.Initialise(playerReader, requirementFactory, logger)); Interact.Key = InteractKey; Interact.Initialise(playerReader, requirementFactory, logger); Blink.Initialise(playerReader, requirementFactory, logger); TargetLastTarget.Key = TargetLastTargetKey; TargetLastTarget.Initialise(playerReader, requirementFactory, logger); GatherFindKeys.ForEach(key => { GatherFindKeyConfig.Add(new KeyAction { Key = key }); GatherFindKeyConfig.Last().Initialise(playerReader, requirementFactory, logger); }); }
// Use this for initialization void Start() { combat = GameObject.FindObjectOfType <Combat>(); screenBounds = Camera.main.ScreenToWorldPoint(new Vector2(Screen.width, Screen.height)); camera.transform.position = new Vector3(screenBounds.x, screenBounds.y, -10); screenBounds = Camera.main.ScreenToWorldPoint(new Vector2(Screen.width, Screen.height)); for (int iii = 0; iii < (tiles * tiles + 1); iii++) { for (int ii = 0; ii < (tiles + 1); ii++) { for (int i = 0; i < (tiles + 1); i++) { lines.Add(Instantiate(line1, new Vector2(transform.position.x + (screenBounds.y / 2 + screenBounds.y * ii), transform.position.y + (i * screenBounds.y / tiles + iii * screenBounds.y / tiles)), transform.rotation)); lines.Add(Instantiate(line2, new Vector2(transform.position.x + (iii * screenBounds.y / tiles + i * screenBounds.y / tiles), transform.position.y + (screenBounds.y / 2 + screenBounds.y * ii)), transform.rotation)); } } } }
private void PerformForesightShot(object sender, EventArgs e) { if (!HostShip.IsCannotAttackSecondTime) { HostShip.OnAttackFinishAsAttacker += SetIsAbilityIsUsed; HostShip.IsCannotAttackSecondTime = true; HostShip.State.Force--; Combat.StartSelectAttackTarget( HostShip, AfterFiresightAttackSubPhase, ForesightAttackFilter, HostUpgrade.UpgradeInfo.Name, "You may perform a bonus Foresight attack against " + foresightTarget.PilotInfo.PilotName, HostUpgrade ); } else { Triggers.FinishTrigger(); } }
public void BasicAttackSpawn() { if (basicAttackBox.Equals(null)) { return; } Vector3 boxSize = basicAttackBox.size; Collider[] colliders = Physics.OverlapBox(basicAttackBox.transform.position, boxSize); foreach (Collider collider in colliders) { if (collider.gameObject.CompareTag(gameObject.tag)) { continue; } Combat combat = null; collider.TryGetComponent <Combat>(out combat); if (combat != null) { combat.Damaged(AttackPow); } } }
public bool OnCast(Character caster, string args) { Character target = ReferenceSpell.FindAndConfirmSpellTarget(caster, args); if (target == null) { return(false); } ReferenceSpell.SendGenericCastMessage(caster, target, true); int totalDamage = (Skills.GetSkillLevel(caster.magic) * (caster.IsPC ? GameSpell.DEATH_SPELL_MULTIPLICAND_PC : GameSpell.DEATH_SPELL_MULTIPLICAND_NPC)) + GameSpell.GetSpellDamageModifier(caster); totalDamage += Rules.RollD(1, 2) == 1 ? Rules.RollD(1, 4) : -(Rules.RollD(1, 4)); if (Combat.DoSpellDamage(caster, target, null, totalDamage, ReferenceSpell.Name.ToLower()) == 1) { Skills.GiveSkillExp(caster, target, Globals.eSkillType.Magic); Rules.GiveKillExp(caster, target); } return(true); }
void AddExplosionForce() { Collider[] colliders = Physics.OverlapSphere(transform.position, forceRadius); for (int i = 0; i < colliders.Length; i++) { Rigidbody targetRigidbody = colliders[i].GetComponent <Rigidbody>(); if (!targetRigidbody) { continue; } targetRigidbody.AddExplosionForce(force, transform.position, forceRadius); Combat combat = targetRigidbody.GetComponent <Combat>(); if (!combat) { continue; } MakeDamage(combat, targetRigidbody.position); } }
public void tick() { getSprites().setSprites(-1, -1); int sprite = -1; if (inCombat()) { Combat.combatLoop(this); } if (getFollow().getFollowing() != null && !isFrozen()) { getFollow().followEntity(); return; } if (minimumCoords == null || maximumCoords == null) { return; //cannot process walking } if (Misc.randomDouble() > 0.8 && walkType == WalkType.RANGE && !inCombat() && !isDead() && !isFrozen()) { int tgtX = getLocation().getX() + Misc.random(-1, 2); //random number from -1,0,1 int tgtY = getLocation().getY() + Misc.random(-1, 2); //random number from -1,0,1 sprite = Misc.direction(getLocation().getX(), getLocation().getY(), tgtX, tgtY); if (tgtX > maximumCoords.getX() || tgtX < minimumCoords.getX() || tgtY > maximumCoords.getY() || tgtY < minimumCoords.getY()) { sprite = -1; } if (sprite != -1) { sprite >>= 1; faceDirection = (FaceDirection)sprite; getSprites().setSprites(sprite, -1); setLocation(new Location(tgtX, tgtY, getLocation().getZ())); } return; } }
private static void MonsterSummon(Room room, Dungeon d, Creature p) { //Did monsters get summoned? int x = Utilities.rand.Next(1, 101); //If yes, int monsterChance = room.modifier + d.monsterSummon; if (x <= monsterChance && fought == false)//Make monsters, fight them { fought = true; //Make monsters, fight them Console.Write("\nYour presence has been noted by"); Utilities.DotDotDot(); //How many monsters? int numroll = Utilities.rand.Next(1, 4); for (int i = 0; i < numroll; i++) { //Which specific monsters? int monsterSelect = Utilities.rand.Next(0, d.bestiary.Length); opponentList.Add(d.bestiary[monsterSelect].MonsterCopy()); } for (int i = 0; i < opponentList.Count; i++) { if (opponentList[i].name.FirstOrDefault() == 'A' || opponentList[i].name.FirstOrDefault() == 'E' || opponentList[i].name.FirstOrDefault() == 'I' || opponentList[i].name.FirstOrDefault() == 'O' || opponentList[i].name.FirstOrDefault() == 'U') { Utilities.EmbedColourText(Colour.MONSTER, "An", $"{opponentList[i].name}", ""); } else { Utilities.EmbedColourText(Colour.MONSTER, "A ", $"{opponentList[i].name}", ""); } } Utilities.Keypress(); Combat.GameCombat(p, opponentList[0]); } }