public void GenerateItems(SwordType curSword, int maxHP) { for (int i = 0; i < 3; i++) { int h = rand.Next(0, 100); if (h >= 95) { if (curSword == SwordType.Wood) { itemsForSale[i] = ItemType.Short; } else if (curSword == SwordType.Short) { itemsForSale[i] = ItemType.Great; } else { if (maxHP < 50) { itemsForSale[i] = ItemType.HeartPiece; } else { itemsForSale[i] = ItemType.Magic; } } } else if (h >= 86) { if (maxHP < 50) { itemsForSale[i] = ItemType.HeartPiece; } else { itemsForSale[i] = ItemType.Magic; } } else if (h >= 50) { itemsForSale[i] = ItemType.Heart; } else if (h >= 25) { itemsForSale[i] = ItemType.Bomb; } else if (h >= 10) { itemsForSale[i] = ItemType.Key; } else { itemsForSale[i] = ItemType.Magic; } } }
private XElement SteelXML() { return(new XElement("item", new XAttribute("name", name), new XAttribute("category", SwordType), new XAttribute("price", price), new XAttribute("initial_durability", "100"), new XAttribute("max_durability", "100"), new XAttribute("enhancement_slots", slotNum), new XAttribute("stackable", "1"), new XAttribute("grid_size", "2"), new XAttribute("equip_template", equipTemplate), new XAttribute("equip_slot", SwordType.ToString().Substring(0, SwordType.ToString().IndexOf('w') - 1) + "_sword_back_slot"), new XAttribute("hold_slot", "r_weapon"), new XAttribute("weapon", "true"), new XAttribute("lethal", "true"), new XAttribute("ability_mode", "OnHold"), new XAttribute("hand", "right"), new XAttribute("sound_identification", "long steel"), new XAttribute("draw_event", "DrawWeapon"), new XAttribute("draw_act", "draw_steel_sword_back_act"), new XAttribute("draw_deact", "draw_steel_sword_back_deact"), new XAttribute("holster_event", "HolsterWeapon"), new XAttribute("holster_act", "holster_steel_sword_back_act"), new XAttribute("holster_deact", "holster_steel_sword_back_deact"), new XAttribute("localisation_key_name", unlocalizedName), new XAttribute("localisation_key_description", unlocalizedName + "_desc"), new XAttribute("icon_path", IconName), new XElement("tags", Tags.Where(x => x.Needed).Select(x => x.Tag + ", ")), new XElement("base_abilities", new XElement("a", name + "Ability _Stats")), new XElement("recycling_parts"), new XElement("anim_actions", new XElement("action", new XAttribute("name", "draw"), new XAttribute("event", "DrawWeapon"), new XAttribute("act", "draw_steel_sword_back_act"), new XAttribute("deact", "draw_steel_sword_back_deact")), new XElement("action", new XAttribute("name", "holster"), new XAttribute("event", "HolsterWeapon"), new XAttribute("act", "holster_steel_sword_back_act"), new XAttribute("deact", "holster_steel_sword_back_deact")), new XElement("action", new XAttribute("name", "attack"), new XAttribute("event", "attack_steel_sword_back"), new XAttribute("act", "attack_steel_sword_back_act"), new XAttribute("deact", "attack_steel_sword_back_deact"))), new XElement("anim_switches", new XElement("anim_switch", new XAttribute("category", "silversword"), new XAttribute("equip_slot", "silver_sword_back_slot"), new XAttribute("event", "silver_to_steel"), new XAttribute("switch_act", "silver_to_steel_act"), new XAttribute("switch_deact", "silver_to_steel_deact"))))); }
private void ChangeType(SwordType type) { swordTypePrevious = swordType; swordType = type; step = 0; timar = 0; }
private void ChangeType(SwordType type, bool reset) { swordTypeStop = swordType; swordType = type; if (reset) { step = 0; timar = 0; swordTypePrevious = swordType; } }
//private void MoveToAttack() //{ // Vector2 vec = new Vector2(swordRight, swordUp); // if(step == 0) //} // //private void AttackToMove() //{ // Vector2 vec = new Vector2(swordRight, swordUp); // if(step == 0) //} // private void SwordStop() { stopTimer -= Time.deltaTime; if (stopTimer < 0) { hitStop = false; Collision.enabled = true; CollisionFlick.enabled = true; swordType = swordTypeStop; return; } }
public IGlowingSword GetGlowingSword(SwordType swordType, bool objectAdapter = true) { switch (swordType) { case SwordType.Short: return(_swords["ShortSword"]); case SwordType.Middle: return((objectAdapter) ? _swords["MiddleSwordObject"] : _swords["MiddleSwordClass"]); default: return(_swords["LongSword"]); } }
// Use this for initialization void Awake() { base.Awake(); _swordType = (SwordType)Random.Range(1, 2); _fsmAnim = GetComponent <FSM_Warrior>(); //_fsmAnim.SetState(UnitState.Idle); _type = EnermyType.Warrior; _waitingTime = 1.0f; SetSword(); StartCoroutine("FindPlayer"); }
public void ShowShop(SwordType curSword, int maxHP) { int r = rand.Next(0, 100); if (r >= 85) { IsShopVisible = true; FindShopLocation(); GenerateItems(curSword, maxHP); } else { IsShopVisible = false; } }
public static Weapon CreateSword(SwordType type) { var sword = new Sword(); // plain, old default sword // override properties based on type switch (type) { case SwordType.SwordOfDamocles: sword.FallTime = GetRandomFutureTime(); break; case SwordType.SwordOfDestiny: sword.Invincible = true; break; ... } return(sword); }
public void UpgradeWeapon() { swordType = SwordType.Katana; GameObject.FindWithTag("Katana").GetComponent <Renderer>().material = katanaMaterial; attackPower = 2; }
public Excalibur(SwordType swordType) : base(swordType) { Damage = 9000; }
public void SetSword(Base.Item item) { SwordType = item.Type; Damage = SwordType.GetAttribute <DamageAttribute>(); }
public void SwordPowers(SwordType type) { switch (type) { case SwordType.Broad: { if (BroadSwordEnabled && BroadCount > 0) { audioSrc.PlayOneShot(BroadSwipe); BroadpowCount.RemoveBroadCounter(1); Rigidbody Temporary_RigidBody; GameObject Temporary_Bullet_Handler; Temporary_Bullet_Handler = Instantiate(Blade, Magic_Thunder_Emitter.transform.position, Magic_Thunder_Emitter.transform.rotation) as GameObject; Temporary_Bullet_Handler.transform.Rotate(30, 180, 0); Temporary_RigidBody = Temporary_Bullet_Handler.GetComponent <Rigidbody>(); Temporary_RigidBody.AddForce(CameraPosition.transform.forward * Flame_Forward_Force * 2); Destroy(Temporary_Bullet_Handler, 0.2f); } break; } case SwordType.Flame: { if (MagicSwordEnabled && MagicCount > 0) { audioSrc.PlayOneShot(MagicFlame); MagicpowCount.RemoveMagicCounter(1); Rigidbody Temporary_RigidBody; GameObject Temporary_Bullet_Handler; Temporary_Bullet_Handler = Instantiate(Flame, Magic_Thunder_Emitter.transform.position, Magic_Thunder_Emitter.transform.rotation) as GameObject; Temporary_Bullet_Handler.transform.Rotate(0, 180, 0); Temporary_RigidBody = Temporary_Bullet_Handler.GetComponent <Rigidbody>(); Temporary_RigidBody.AddForce(CameraPosition.transform.forward * Flame_Forward_Force); } break; } case SwordType.Thunder: { if (ThunderSwordEnabled && ThunderCount > 0) { audioSrc.PlayOneShot(ThunderBall); ThunderpowCount.RemoveThunderCounter(1); Rigidbody Temporary_RigidBody; GameObject Temporary_Bullet_Handler; Temporary_Bullet_Handler = Instantiate(ElectroBall, Magic_Thunder_Emitter.transform.position, Magic_Thunder_Emitter.transform.rotation) as GameObject; Temporary_Bullet_Handler.transform.Rotate(Vector3.left); Temporary_RigidBody = Temporary_Bullet_Handler.GetComponent <Rigidbody>(); Temporary_RigidBody.AddForce(CameraPosition.transform.forward * Electroball_Forward_Force); } break; } case SwordType.Glace: { if (IceSwordEnabled && IceCount > 0) { audioSrc.volume = 1.0f; audioSrc.pitch = Random.Range(0.8f, 1.0f); audioSrc.PlayOneShot(IceShield); IcepowCount.RemoveIceCounter(1); Rigidbody Temporary_RigidBody; GameObject Temporary_Bullet_Handler; Temporary_Bullet_Handler = Instantiate(Shield, Ice_Emitter.transform.position, Ice_Emitter.transform.rotation) as GameObject; Temporary_Bullet_Handler.transform.Rotate(Vector3.left); Temporary_RigidBody = Temporary_Bullet_Handler.GetComponent <Rigidbody>(); Temporary_RigidBody.AddForce(CameraPosition.transform.forward * Flame_Forward_Force); } break; } } }
public void DrawSword(SwordType st) { short start = (short)(Console.WindowWidth / 3); for (short x = start; x < (start + 11); x++) { EngineFunctions.DrawToConsole(new EngineFunctions.COORD(x, (short)(Console.WindowHeight - 2)), '-', ConsoleColor.White); if (x == start + 2 || x == start + 8) { EngineFunctions.DrawToConsole(new EngineFunctions.COORD(x, (short)(Console.WindowHeight - 8)), ' ', ConsoleColor.White); } else if (x == start + 3) { EngineFunctions.DrawToConsole(new EngineFunctions.COORD(x, (short)(Console.WindowHeight - 8)), "Space", ConsoleColor.White); } else if (x >= start + 4 && x <= start + 7) { continue; } else { EngineFunctions.DrawToConsole(new EngineFunctions.COORD(x, (short)(Console.WindowHeight - 8)), '-', ConsoleColor.White); } } for (short y = (short)(Console.WindowHeight - 8); y <= Console.WindowHeight - 2; y++) { EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start - 1), y), '|', ConsoleColor.White); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 11), y), '|', ConsoleColor.White); } switch (st) { case SwordType.Wood: default: for (short y = 0; y < 4; y++) { if (y == 2) { for (short x = 0; x < 3; x++) { EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 4 + x), (short)(Console.WindowHeight - 6 + y)), '=', ConsoleColor.DarkYellow); } } else { EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 5), (short)(Console.WindowHeight - 6 + y)), '|', ConsoleColor.DarkYellow); } } break; case SwordType.Short: EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 7), (short)(Console.WindowHeight - 6)), '/', ConsoleColor.Gray); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 6), (short)(Console.WindowHeight - 5)), '/', ConsoleColor.Gray); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 4), (short)(Console.WindowHeight - 3)), '/', ConsoleColor.Gray); for (short x = 0; x < 3; x++) { EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 4 + x), (short)(Console.WindowHeight - 4)), '=', ConsoleColor.Gray); } EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 3), (short)(Console.WindowHeight - 4)), '<', ConsoleColor.Gray); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 7), (short)(Console.WindowHeight - 4)), '>', ConsoleColor.Gray); break; case SwordType.Great: EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 6), (short)(Console.WindowHeight - 7)), '/', ConsoleColor.Cyan); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 7), (short)(Console.WindowHeight - 7)), '\\', ConsoleColor.Cyan); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 5), (short)(Console.WindowHeight - 6)), '/', ConsoleColor.Cyan); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 7), (short)(Console.WindowHeight - 6)), '/', ConsoleColor.Cyan); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 4), (short)(Console.WindowHeight - 5)), '/', ConsoleColor.Cyan); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 6), (short)(Console.WindowHeight - 5)), '/', ConsoleColor.Cyan); for (short x = 0; x < 4; x++) { EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 3 + x), (short)(Console.WindowHeight - 4)), '=', ConsoleColor.Cyan); } EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 2), (short)(Console.WindowHeight - 4)), '<', ConsoleColor.Cyan); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 7), (short)(Console.WindowHeight - 4)), '>', ConsoleColor.Cyan); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 3), (short)(Console.WindowHeight - 3)), '/', ConsoleColor.Cyan); EngineFunctions.DrawToConsole(new EngineFunctions.COORD((short)(start + 4), (short)(Console.WindowHeight - 3)), '/', ConsoleColor.Cyan); break; } }
public void UpgradeWeapon() { swordType = SwordType.Katana; attackPower = 2; }
public Sword(SwordType swordType) { Type = swordType; }
private void ChangeType(SwordType type,bool reset) { swordTypeStop = swordType; swordType = type; if (reset) { step = 0; timar = 0; swordTypePrevious = swordType; } }
public Sword(SwordType type) { SwordType = type; }