void SetRandomAttackStyle() { AttackStyle currentAttack = attackStyle; AttackStyle attack; int numAttacks = System.Enum.GetNames(typeof(AttackStyle)).Length; int count = 0; while (true) { count++; int i = Random.Range(0, numAttacks); attack = (AttackStyle)i; //Debug.LogFormat("changeAttack: numAttack=={0}, i =={1}, attack==", numAttacks, i, attack.ToString()); if (attack != currentAttack && !( (attack == AttackStyle.fire && !enableFire) || (attack == AttackStyle.multishot && !enableMultishot) || (attack == AttackStyle.shockwave && !enableShockwave))) { Debug.LogFormat("Changing boss attack from {0} to {1}", currentAttack, attack); attackStyle = attack; break; } if (count > 100) { Debug.LogError("couldn't find another attack to go to"); break; } } }
void BeginTyping(int stringID, AttackStyle style, float typeSpeed) { List <int> letterIDs = new List <int>(); string text = FindText(stringID); text = text.ToLower(); char[] chars = text.ToLower().ToCharArray(); //FIND SPECIAL CHARACTERS HERE TOO for (int i = 0; i < chars.Length; i++) { //Finding letter id's to use for instantiation for (int m = 0; m < letters.Length; m++) { if (chars[i] == letters[m]) { letterIDs.Add(m); break; } } } StartCoroutine(TypeSlowly(typeSpeed, style, letterIDs, chars)); }
public void Attacking() { if (entranceDone == false) { entranceDone = true; } switch (style) { case AttackStyle.Aim: if (shootingTimer >= attack1FireRate) { Attack1(); shootingTimer = 0f; } break; case AttackStyle.Spin: if (shootingTimer >= attack2FireRate) { Attack2(); shootingTimer = 0f; } break; } lastStyle = style; }
public BaseCharacter() { Name = ""; Level = 1; Attributes = new List <Attribute>(); Vitals = new List <Vital>(); Stats = new List <Statistic>(); CharacterType = CharacterType.Enemy; AttackStyle = AttackStyle.Melee; VitalHandler = new VitalHandler(this); AnimationType = RPGAnimationType.Legacy; LegacyAnimations = new LegacyAnimation(); Alive = true; Stunned = Silenced = StunFreeze = Retreating = false; ImagePath = ""; AuraEffects = new List <AuraEffect>(); FriendlyAuras = new List <FriendlyAura>(); TimedPassiveEffects = new List <TimedPassiveEffect>(); StatusEffects = new List <StatusEffect>(); CurrentDoTs = new List <DamageOverTime>(); SkillMetaImmunitiesID = new List <SkillImmunity>(); SkillMetaSusceptibilities = new List <SkillMetaSusceptibility>(); VitalRegenBonuses = new List <VitalRegenBonus>(); Restorations = new List <Restoration>(); StatusReductions = new List <ReduceStatusDuration>(); ProcEffects = new List <Rm_ProcEffect>(); }
public MapProjectile(int projectileID, CharacterType parentType, int characterID, Vector2 position, FacingDirection direction) { ProjectileID = projectileID; ParentType = parentType; CharacterID = characterID; TargetType = CharacterType.Player; TargetID = -1; Position = position; Direction = direction; float velocityX = (direction == FacingDirection.Down || direction == FacingDirection.Up) ? 0 : GetData().Speed * 32; if (direction == FacingDirection.Left) { velocityX = -velocityX; } float velocityY = (direction == FacingDirection.Left || direction == FacingDirection.Right) ? 0 : GetData().Speed * 32; if (direction == FacingDirection.Up) { velocityY = -velocityY; } Velocity = new Vector2(velocityX, velocityY); Lifespan = 0; OnBridge = false; Destroyed = false; Style = AttackStyle.None; AttackPower = 0; Changed = false; }
public Player(Connection connection) { this.connection = connection; //without this, new Packets(this); wouldn't function. if (connection != null) { loginDetails = connection.getLoginDetails(); } appearance = new Appearance(); follow = new Follow(this); bank = new Bank(this); inventory = new Inventory(this); equipment = new Equipment(this); friends = new Friends(this); prayers = new Prayers(this); skills = new Skills(this); attackStyle = new AttackStyle(); packets = new Packets(this); localEnvironment = new LocalEnvironment(this); updateFlags = new AppearanceUpdateFlags(this); walkingQueue = new WalkingQueue(this); specialAttack = new SpecialAttack(this); chat = true; split = false; mouse = true; aid = false; magicType = 1; achievementDiaryTab = false; forgeCharge = 40; smallPouchAmount = 0; mediumPouchAmount = 0; largePouchAmount = 0; giantPouchAmount = 0; defenderWave = 0; autoRetaliate = false; vengeance = false; lastVengeanceTime = 0; poisonAmount = 0; specialAmount = 100; skullCycles = 0; recoilCharges = 40; barrowTunnel = -1; barrowKillCount = 0; barrowBrothersKilled = new bool[6]; slayerPoints = 0; removedSlayerTasks = new string[4]; for (int i = 0; i < removedSlayerTasks.Length; i++) { removedSlayerTasks[i] = "-"; } agilityArenaStatus = 0; taggedLastAgilityPillar = false; paidAgilityArena = false; teleblockTime = 0; lastHit = -1; prayerDrainRate = 0; superAntipoisonCycles = 0; antifireCycles = 0; tradeRequests = new List <Player>(); duelRequests = new List <Player>(); }
public Bullet(GameObject go, AttackStyle style, Vector3 dir, GameObject targ) { obj = go; attackStyle = style; aimDirection = dir; targetObj = targ; //velocity = startingVelocity; bulletListIndex = bullets.Count; }
public void ChangeStyle(AttackStyle newStyle) { if (newStyle == CurrentAttackStyle) { return; } CurrentAttackStyle = newStyle; EventsManager.TriggerEvent("Change Attack Style", CurrentAttackStyle); }
public static float CharacterCastRange(AttackStyle attackStyle) { float rangeValue; var foundValue = AttackStyleRangeValues.TryGetValue(attackStyle, out rangeValue); if (!foundValue) { throw new KeyNotFoundException(); } return(rangeValue); }
private void ChangeAttackName(AttackStyle attackStyle, AttackType attackType) { currentAttackName = (Controller.OnGround()) ? ((attackType == AttackType.Primary) ? lightAttackName : heavyAttackName) : ((attackType == AttackType.Primary) ? aerialLightAttackName : aerialHeavyAttackName); string currentStyleName = "Style"; currentStyleName = attackStyle.ToString() + " " + currentStyleName; currentAttackName = currentAttackName.Replace("Style", currentStyleName) + Controller.AttackIndex; }
public WeaponTypeDefinition() { ID = Guid.NewGuid().ToString(); AttackStyle = AttackStyle.Melee; AttackRange = 2.0f; AttackSpeed = 1.2f; ProjectileTravelSound = new AudioContainer(); AutoAttackImpactSound = new AudioContainer(); ProjectileSpeed = 10f; }
protected virtual void Awake() { thisWorldObject = GetComponent <WorldObject>(); if (thisWorldObject.statsDick.ContainsKey(StatsType.RangedStats)) { thisAttackStyle = gameObject.AddComponent <Ranged>(); } else { thisAttackStyle = gameObject.AddComponent <Melee>(); } }
public Rm_ClassDefinition() { ID = Guid.NewGuid().ToString(); ApplicableRaceID = ""; ApplicableSubRaceID = ""; ApplicableGenderID = ""; ApplicableClassIDs = new List <StringField>(); ExpDefinitionID = Rmh_Experience.PlayerExpDefinitionID; Name = "Unnamed Class"; Description = "A strong combatant."; ClassPrefabPath = ""; UnarmedAttackRange = 1.5f; UnarmedAttackSpeed = 2.0f; UnarmedAttackDamage = 1; AutoAttackPrefabPath = ""; AttackStyle = AttackStyle.Melee; StartingScene = ""; StartingGold = 0; ImagePath = ""; AnimationType = RPGAnimationType.Legacy; LegacyAnimations = new LegacyAnimation(); ProjectileTravelSound = new AudioContainer(); AutoAttackImpactSound = new AudioContainer(); ProjectileSpeed = 10f; HasStartingPet = false; StartingPet = ""; StartingAttributes = new List <Rm_AsvtAmount>(); StartingStats = new List <Rm_AsvtAmountFloat>(); StartingVitals = new List <Rm_AsvtAmount>(); StartingTraitLevels = new List <Rm_AsvtAmount>(); StartingItems = new List <LootDefinition>(); StartingEquippedWeapon = new StartEquipDefinition(); StartingEquipped = new List <StartEquipDefinition>(); AttributePerLevel = new List <Rm_AsvtAmount>(); StartingSkillIds = new List <string>(); StartingTalentIds = new List <string>(); SkillMetaImmunitiesID = new List <string>(); SkillMetaSusceptibilities = new List <SkillMetaSusceptibility>(); EquipmentInfo = new EquipmentInfo(); VisualCustomisations = new List <VisualCustomisation>(); }
private void Initialize(string name) { Name = name; BaseStats = new CombatStats(); AtkStyle = AttackStyle.Melee; VisionRage = 1; AttackRange = 1; WanderRange = 5; Experience = 0; AgroLvl = 1; ProjectileID = -1; SpriteID = -1; Speed = MovementSpeed.Normal; DropTable = -1; }
//playerDir = transform.position public void attackChange(AttackStyle attack) { attackStyle = attack; switch (attack) //Update gun stats here { case AttackStyle.fire: { //bulletNumber = 1; //inaccuracy = 0; //heat = 20; //windupReq = 0; //size = 1; //fireForce = 1000; break; } } //shot = shots[(int)attackStyle]; }
// Use this for initialization void Start() { entranceDone = false; audioManagerBoss.gameObject.SetActive(true); audioManagerMain.gameObject.SetActive(false); entranceFinished = false; animation = this.gameObject.GetComponent <Animation>(); currentHP = initHP; timer = timeBetweenAttackPhases; modeCounter = 0; shootingTimer = 0f; shotCounter = 0; lastStyle = style; healthBar.ValueBossHealth((float)initHP, (float)currentHP); animation.Play("BossEntrance"); cannonA.objectsManager = objectsManager; cannonB.objectsManager = objectsManager; cannonS.objectsManager = objectsManager; playerOrbit = player.gameObject.transform.GetChild(0).gameObject; playerOrbit.SetActive(false); }
public static string GetAttackAnimationName(AttackStyle _style) { switch (_style) { case AttackStyle.Hammering: return("attack"); case AttackStyle.StrongHammering: return("attack"); case AttackStyle.Clothesline: return("laliatt"); case AttackStyle.DropKick: return("dropkick"); case AttackStyle.Chop: return("chop"); } return("attack"); }
public static float GetAttackAnimationTime(AttackStyle _atkStyle) { switch (_atkStyle) { case AttackStyle.Hammering: return(0.6f); case AttackStyle.StrongHammering: return(0f); case AttackStyle.DropKick: return(0.8f); case AttackStyle.Clothesline: return(0.65f); case AttackStyle.Chop: return(0.6f); } return(0f); }
public void ToggleMode() { if (modeCounter >= attacksBeforeModeSwitch) { modeCounter = 0; //timer = -2; if (style == AttackStyle.Aim) { style = AttackStyle.Spin; timer = -delayFromAimToSpin; } else { style = AttackStyle.Aim; timer = -delayFromSpinToAim; } } if (modeCounter == attacksBeforeModeSwitch / 2 && shotCounter >= attackNumberOfShots) { cannonS.ToggleRotationDirection(); } }
public static void configureButton(Player p, int interfaceId, int button) { AttackStyle av = p.getAttackStyle(); switch (interfaceId) { case 92: // Unarmed attack interface. switch (button) { case 2: // Punch (Attack XP) - Crush av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(0); break; case 3: // Kick (Strength XP) - Crush av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(1); break; case 4: // Block (Defence XP) - Crush av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(2); break; } break; case 93: // Whip attack interface. switch (button) { case 2: // Flick (Attack XP) - Slash av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(0); break; case 3: // Lash (Shared XP) - Slash av.setSkill(AttackStyle.CombatSkill.CONTROLLED); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(1); break; case 4: // Deflect (Defence XP) - Slash av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(2); break; } break; case 89: // Dagger attack interface. switch (button) { case 2: // Stab (Attack XP) - Stab av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.STAB); av.setSlot(0); break; case 3: // Lunge (Strength XP) - Stab av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.STAB); av.setSlot(1); break; case 4: // Slash (Strength XP) - Slash av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(2); break; case 5: // Block (Defence XP) - Stab av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.STAB); av.setSlot(3); break; } break; case 82: // Longsword/scimitar attack interface. switch (button) { case 2: // Chop (Attack XP) - Slash av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(0); break; case 3: // Slash (Strength XP) - Slash av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(1); break; case 4: // Smash (Strength XP) - Crush av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(2); break; case 5: // Block (Defence XP) - Slash av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(3); break; } break; case 78: // Claw attack interface. switch (button) { case 2: // Chop (Attack XP) - Slash av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(0); break; case 5: // Slash (Strength XP) - Slash av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(1); break; case 4: // Lunge (Shared XP) - Stab av.setSkill(AttackStyle.CombatSkill.CONTROLLED); av.setStyle(AttackStyle.CombatStyle.STAB); av.setSlot(2); break; case 3: // Block (Defence XP) - Slash av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(3); break; } break; case 81: // Godsword attack interface. switch (button) { case 2: // Chop (Attack XP) - Slash av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(0); break; case 3: // Slash (Strength XP) - Slash av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(1); break; case 4: // Lunge (Shared XP) - Stab av.setSkill(AttackStyle.CombatSkill.CONTROLLED); av.setStyle(AttackStyle.CombatStyle.STAB); av.setSlot(2); break; case 5: // Block (Defence XP) - Slash av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(3); break; } break; case 88: // Mace attack interface. switch (button) { case 2: // Pound (Attack XP) - Crush av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(0); break; case 3: // Pummel (Strength XP) - Crush av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(1); break; case 4: // Spike (Shared XP) - Stab av.setSkill(AttackStyle.CombatSkill.CONTROLLED); av.setStyle(AttackStyle.CombatStyle.STAB); av.setSlot(2); break; case 5: // Block (Defence XP) - Crush av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(3); break; } break; case 76: // Granite maul attack interface. switch (button) { case 2: // Pound (Attack XP) - Crush av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(0); break; case 4: // Pummel (Strength XP) - Crush av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(1); break; case 3: // Block (Defence XP) - Crush av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(2); break; } break; case 77: // Bow attack interface. switch (button) { case 2: // Accurate (Range XP) - Accurate av.setSkill(AttackStyle.CombatSkill.RANGE); av.setStyle(AttackStyle.CombatStyle.RANGE_ACCURATE); av.setSlot(0); break; case 4: // Rapid (Range XP) - Rapid av.setSkill(AttackStyle.CombatSkill.RANGE); av.setStyle(AttackStyle.CombatStyle.RANGE_RAPID); av.setSlot(1); break; case 3: // Longrange (Range XP) - Defensive av.setSkill(AttackStyle.CombatSkill.RANGE); av.setStyle(AttackStyle.CombatStyle.RANGE_DEFENSIVE); av.setSlot(2); break; } break; case 75: // Battleaxe attack interface. switch (button) { case 2: // Chop (Attack XP) - Slash av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(0); break; case 5: // Hack (Strength XP) - Slash av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(1); break; case 4: // Smash (Strength XP) - Crush av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(2); break; case 3: // Block (Defence XP) - Slash av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.SLASH); av.setSlot(3); break; } break; case 91: // Thrown weapon switch (button) { case 2: // Accurate (Range XP) - Accurate av.setSkill(AttackStyle.CombatSkill.RANGE); av.setStyle(AttackStyle.CombatStyle.RANGE_ACCURATE); av.setSlot(0); break; case 4: // Rapid (Range XP) - Rapid av.setSkill(AttackStyle.CombatSkill.RANGE); av.setStyle(AttackStyle.CombatStyle.RANGE_RAPID); av.setSlot(1); break; case 3: // Longrange (Range XP) - Defensive av.setSkill(AttackStyle.CombatSkill.RANGE); av.setStyle(AttackStyle.CombatStyle.RANGE_DEFENSIVE); av.setSlot(2); break; } break; case 85: // Spear switch (button) { case 2: // Bash (Attack XP) - Crush av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(0); break; case 4: // Pound (Strength XP) - Crush av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(1); break; case 3: // Block (Defense XP) - Crush av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(2); break; } break; case 90: // Staff interface switch (button) { case 2: // Bash (Attack XP) - Crush av.setSkill(AttackStyle.CombatSkill.ACCURATE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(0); break; case 4: // Pound (Strength XP) - Crush av.setSkill(AttackStyle.CombatSkill.AGGRESSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(1); break; case 3: // Focus (Defense XP) - Crush av.setSkill(AttackStyle.CombatSkill.DEFENSIVE); av.setStyle(AttackStyle.CombatStyle.CRUSH); av.setSlot(2); break; } break; } }
public static void setButtonForAttackStyle(Player p, int interfaceId) { if (interfaceId == -1) { return; } AttackStyle av = p.getAttackStyle(); AttackStyle.CombatSkill type = av.getSkill(); AttackStyle.CombatStyle type2 = av.getStyle(); int slot = av.getSlot(); switch (interfaceId) { case 92: // Unarmed if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 2); av.setSlot(2); } break; case 93: // Whip attack interface. if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.CONTROLLED) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 2); av.setSlot(2); } break; case 89: // Dagger attack interface. if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if ((type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.STAB)) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if ((type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.SLASH))) { p.getPackets().sendConfig(43, 2); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 3); av.setSlot(3); } break; case 82: // Longsword/scimitar attack interface. if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.SLASH) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.CRUSH)) { p.getPackets().sendConfig(43, 2); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 3); av.setSlot(3); } break; case 78: // Claw attack interface. if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.CONTROLLED)) { p.getPackets().sendConfig(43, 2); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 3); av.setSlot(3); } break; case 81: // Godsword attack interface. if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.CONTROLLED)) { p.getPackets().sendConfig(43, 2); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 3); av.setSlot(3); } break; case 88: // Mace attack interface. if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.CONTROLLED)) { p.getPackets().sendConfig(43, 2); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 3); av.setSlot(3); } break; case 76: // Granite maul attack interface. if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 2); av.setSlot(2); } break; case 77: // Bow attack interface. if (type2.Equals(AttackStyle.CombatStyle.RANGE_ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type2.Equals(AttackStyle.CombatStyle.RANGE_RAPID) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type2.Equals(AttackStyle.CombatStyle.RANGE_DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 2); av.setSlot(2); } break; case 75: // Battleaxe attack interface. if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.SLASH) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) && type2.Equals(AttackStyle.CombatStyle.CRUSH)) { p.getPackets().sendConfig(43, 2); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 3); av.setSlot(3); } break; case 91: // Thrown weapon if (type2.Equals(AttackStyle.CombatStyle.RANGE_ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type2.Equals(AttackStyle.CombatStyle.RANGE_RAPID) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type2.Equals(AttackStyle.CombatStyle.RANGE_DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 2); av.setSlot(2); } break; case 85: // Spear if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 2); av.setSlot(2); } break; case 90: // Staff interface if (type.Equals(AttackStyle.CombatSkill.ACCURATE) || slot == 0) { p.getPackets().sendConfig(43, 0); } else if (type.Equals(AttackStyle.CombatSkill.AGGRESSIVE) || slot == 1) { p.getPackets().sendConfig(43, 1); } else if (type.Equals(AttackStyle.CombatSkill.DEFENSIVE) || slot == 2 || slot == 3) { p.getPackets().sendConfig(43, 2); av.setSlot(2); } break; } }
public ShipData(ShipDesignData shipDesignData) { designData = shipDesignData; DisplayName = designData.Design.Name; ForeSection = new ShipQuadrant(this, designData.ForeQuadrant, QuadrantTypes.Fore); AftSection = new ShipQuadrant(this, designData.AftQuadrant, QuadrantTypes.Aft); StarboardSection = new ShipQuadrant(this, designData.StarboardQuadrant, QuadrantTypes.Starboard); PortSection = new ShipQuadrant(this, designData.PortQuadrant, QuadrantTypes.Port); CenterSection = new ShipQuadrant(this, designData.CenterQuadrant, QuadrantTypes.Center); //Add Fighters foreach (KeyValuePair <FighterDefinition, int> keyVal in shipDesignData.Fighters) { Fighters.Add(new FighterComplement(keyVal.Key, keyVal.Value)); } foreach (KeyValuePair <FighterDefinition, int> keyVal in shipDesignData.HeavyFighters) { HeavyFighters.Add(new FighterComplement(keyVal.Key, keyVal.Value)); } foreach (KeyValuePair <FighterDefinition, int> keyVal in shipDesignData.AssaultPods) { AssaultPods.Add(new FighterComplement(keyVal.Key, keyVal.Value)); } fuelMax = designData.Fuel; fuel = fuelMax; ammo = designData.Ammo; ammoMax = designData.Ammo; power = designData.PowerStorage; powerMax = designData.PowerStorage; crew = designData.Crew; crewMax = designData.Crew; supplies = designData.Supplies; suppliesMax = designData.Supplies; troops = designData.Troops; troopsMax = designData.Troops; commandPoints = designData.CommandPoints; mass = designData.Mass; powerGenerated = designData.PowerGenerated; FTLSpeed = designData.FTLSpeed; research = designData.Research; mining = designData.Mining; repair = designData.Repair; ammoGenerated = designData.AmmoGenerated; transporter = designData.Transporter; medical = designData.Medical; cloakingPower = designData.CloakingPower; stealth = designData.Stealth; boardingDefense = designData.BoardingDefense; colonies = designData.Colonies; diplomacy = designData.Diplomacy; sensor = designData.Sensor; longRangeSensor = designData.LongRangeSensor; advancedSensor = designData.AdvancedSensor; CalculateEngines(); AttackDirection = designData.Design.attackDirection; AttackStyle = designData.Design.attackStyle; if (designData.Design.attackRange != -1) { attackRange = designData.Design.attackRange; } else { attackRange = designData.maxRange; } SetCrewEffeciency(); }
public override void Update(GameTime gameTime) { if ((this.GetZuanTouPostion() - AIBase.Player.Locate).Length() <= 20) { AIBase.Player.Status = AIBase.Status.Freeze; }//钻头的判定 if ((this.Locate - AIBase.Player.Locate).Length() < 40) { AIBase.Player.Status = AIBase.Status.Kick; } if (this.Status == AIBase.Status.Alarm) { this.CurrentAttackStyle = AttackStyle.Style1; this.Attack1Status = AttackStyle1.Charge; this.Status = AIBase.Status.Attck; } switch (this.CurrentAttackStyle) { case AttackStyle.Style1: this.AttackStyle1Update(gameTime); break; case AttackStyle.Style2: this.AttackStyle2Update(); break; default: break; } this.Speed.Radian = ( AIBase.Player.Locate - this.Locate ).Radian(); RadianGenerate( gameTime ); this.Rotate = m_rotate; base.Update(gameTime); }
IEnumerator TypeSlowly(float typeSpeed, AttackStyle attack, List <int> letterNums, char[] chars) { bool inWord = false; GameObject currentParent = null; Vector3 nextLetterPosition = Vector3.zero; GameObject spawnDummy = null; Rigidbody rigid = null; List <GameObject> parents = new List <GameObject>(); GameObject megaParent = null; if (attack == AttackStyle.sideL || attack == AttackStyle.sideR || attack == AttackStyle.arcingL || attack == AttackStyle.arcingR) { megaParent = new GameObject(); } switch (attack) { case AttackStyle.above: spawnDummy = tlDummy; break; case AttackStyle.sideL: spawnDummy = blDummy; break; case AttackStyle.sideR: spawnDummy = brDummy; break; case AttackStyle.noDamage: spawnDummy = tlDummy; break; case AttackStyle.extra1: spawnDummy = extra1; attack = AttackStyle.noDamage; break; case AttackStyle.extra2: spawnDummy = extra2; attack = AttackStyle.noDamage; break; case AttackStyle.extra3: spawnDummy = extra3; attack = AttackStyle.noDamage; break; case AttackStyle.arcingL: spawnDummy = blDummy; break; case AttackStyle.arcingR: spawnDummy = brDummy; break; } for (int i = 0; i < chars.Length; i++) { yield return(new WaitForSeconds(typeSpeed)); if (inWord && letterNums[i] == 26) { inWord = false; } if (!inWord) { if (currentParent != null && attack == AttackStyle.above) { rigid.isKinematic = false; rigid.useGravity = true; } if (attack == AttackStyle.noDamage && currentParent != null) { StartCoroutine(DestroyTimer(currentParent, noDamageDestroy)); } inWord = true; currentParent = new GameObject(); currentParent.transform.position = spawnDummy.transform.position; if (attack == AttackStyle.sideL || attack == AttackStyle.sideR || attack == AttackStyle.arcingL || attack == AttackStyle.arcingR) { parents.Add(currentParent); } if (attack == AttackStyle.above) { currentParent.AddComponent <DamagingObject>().isParent = true; rigid = currentParent.AddComponent <Rigidbody>(); rigid.useGravity = false; rigid.mass = 10; rigid.isKinematic = false; rigid.constraints = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY; } } if (letterNums[i] != 26) { GameObject currentLetter = Instantiate(letterObjects[letterNums[i]], spawnDummy.transform.position, Quaternion.identity); currentLetter.transform.SetParent(currentParent.transform, true); currentLetter.transform.position += new Vector3(nextLetterPosition.x, 0, 0); nextLetterPosition.x -= letterSpacing; } else { nextLetterPosition.x -= wordSpacing; } } if (attack == AttackStyle.sideL || attack == AttackStyle.sideR || attack == AttackStyle.arcingL || attack == AttackStyle.arcingR) { for (int i = 0; i < parents.Count; i++) { parents[i].transform.SetParent(megaParent.transform); } megaParent.AddComponent <DamagingObject>().isMegaParent = true; Rigidbody rig = megaParent.AddComponent <Rigidbody>(); rig.constraints = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotationX | RigidbodyConstraints.FreezeRotationY; if (attack == AttackStyle.sideL) { rig.AddForce(Vector3.left * 1000); } else if (attack == AttackStyle.sideR) { rig.AddForce(Vector3.left * -1 * 1000); } if (attack == AttackStyle.arcingL) { rig.AddForce((Vector3.left + Vector3.up) * 350); } else if (attack == AttackStyle.arcingR) { rig.AddForce((Vector3.right + Vector3.up) * 350); } } if (currentParent != null && currentParent.GetComponent <Rigidbody>()) { rigid.isKinematic = false; rigid.useGravity = true; } else if (attack == AttackStyle.noDamage) { StartCoroutine(DestroyTimer(currentParent, noDamageDestroy)); } }
public void SetWeaponEquip(S_Weapon weapon) { weaponEquipped = weapon; //set other weapons inactive if (otherWeapons != null) { foreach (object obj in otherWeapons.transform) { Transform child = (Transform)obj; child.gameObject.SetActive(false); } } //set selected weapons active switch (weaponEquipped) { case S_Weapon.DAGGER: Weapon = transform.Find("Weapon/Dagger").gameObject; attackStyle = AttackStyle.Slash; attackPlaceHolder = Slash; break; case S_Weapon.RAPIER: Weapon = transform.Find("Weapon/Rapier").gameObject; attackStyle = AttackStyle.Slash; attackPlaceHolder = Slash; break; case S_Weapon.SPEAR: Weapon = transform.Find("Weapon/Spear").gameObject; attackStyle = AttackStyle.Thrust; attackPlaceHolder = Thrust; break; case S_Weapon.LONGSPEAR: Weapon = transform.Find("Weapon/LongSpear").gameObject; attackStyle = AttackStyle.Thrust; attackPlaceHolder = Thrust; break; case S_Weapon.LONGSWORD: Weapon = transform.Find("Weapon/LongSword").gameObject; attackStyle = AttackStyle.Slash; attackPlaceHolder = Slash; break; case S_Weapon.ARROW: Weapon = transform.Find("Weapon/Arrow").gameObject; attackStyle = AttackStyle.Bow; attackPlaceHolder = Slash; break; case S_Weapon.BOW: Weapon = transform.Find("Weapon/Bow").gameObject; attackStyle = AttackStyle.Bow; attackPlaceHolder = Slash; break; } Weapon.SetActive(true); WeaponAnim = Weapon.GetComponent <Animator>(); WeaponAnim.SetBool(attackStyle.ToString(), attackPlaceHolder); }
public PlayerAnimationClipsData GetCurrentAttackData (AttackType currentAttack, AttackStyle currentStyle, int attackIndex, bool onGround) { return(CurrentAttacksAnimations[PlayerAttacksKeys.GenerateKeyValue(onGround, currentAttack, currentStyle) + attackIndex]); }
public void SetAttackStyle(AttackStyle style) { AttackStyleSelection.SelectedIndex = (int)style; }