public override void Write(TextWriter writer) { LessThan.Write(writer); Slash.Write(writer); Name.Write(writer); GreaterThan.Write(writer); }
private static bool FromApi(string url) { var virtualPath = HostingEnvironment.ApplicationVirtualPath; var apiUrl = Slash.Trim(Slash.JoinTrimming(virtualPath, "api")); return(Slash.TrimStart(url).StartsWith(apiUrl, StringComparison.Ordinal)); }
private void Button_Ok_Click(object sender, EventArgs e) { Slash Slash = null; if (Element == null || !(Element.Value is Slash)) { Slash = new Slash(); } else { Slash = Element.Value as Slash; } if (rButton_Clockwise.Checked) { Slash.RotationStyle = RotationStyle.Clockwise; } else { Slash.RotationStyle = RotationStyle.Counterclockwise; } Slash.Text = tBoxSlashText.Text; this.DialogResult = DialogResult.OK; Close(); }
void ADCAttack() { AnimatorStateInfo stateInfo = anim.GetCurrentAnimatorStateInfo(0); bool loading = stateInfo.IsName("tony_poder"); if (Input.GetKeyDown(KeyCode.LeftAlt)) { if (hp > 0) { if (Time.time > nextFireTime) { GetComponent <AudioSource>().Play(); anim.SetTrigger("atacando"); // Para que se mueva desde el principio tenemos que asignar un // valor inicial al movX o movY en el edtitor distinto a cero float angle = Mathf.Atan2( anim.GetFloat("movY"), anim.GetFloat("movX") ) * Mathf.Rad2Deg; GameObject slashObj = Instantiate( bananaPrefab, transform.position, Quaternion.AngleAxis(angle, Vector3.forward) ); Slash slash = slashObj.GetComponent <Slash>(); slash.mov.x = anim.GetFloat("movX"); slash.mov.y = anim.GetFloat("movY"); nextFireTime = Time.time + coolDownTime; } } } }
void SlashAttack() { // Buscamos el estado actual mirando la información del animador //AnimatorStateInfo stateInfo = anim.GetCurrentAnimatorStateInfo (0); // Ataque a distancia CAMBIAR DELAYARMA PARA QUE EL PROJECTIL VAYA MAS LENTO/RAPIDO if (Input.GetKeyUp(KeyCode.Space)) { anim.SetBool("Atacando", false); } else if (Input.GetKeyDown(KeyCode.Space) && delayArma > 0.3) { anim.SetBool("Atacando", true); float angle = Mathf.Atan2(anim.GetFloat("MovY"), anim.GetFloat("MovX")) * Mathf.Rad2Deg; GameObject slashObj = Instantiate(slashPrefab, transform.position, Quaternion.AngleAxis(angle, Vector3.forward)); AudioManager.instance.Play("Disparo"); Slash slash = slashObj.GetComponent <Slash> (); delayArma = 0; } }
void SlashAttack() { AnimatorStateInfo estado = anim.GetCurrentAnimatorStateInfo(0); bool loading = estado.IsName("Player_Slash"); if (Input.GetKeyDown(KeyCode.LeftAlt)) { anim.SetTrigger("loading"); } else if (Input.GetKeyUp(KeyCode.LeftAlt)) { anim.SetTrigger("attacking"); float angle = Mathf.Atan2( anim.GetFloat("movX"), anim.GetFloat("movY") ) * Mathf.Rad2Deg; GameObject slashObj = Instantiate( slashPrefab, transform.position, Quaternion.AngleAxis(angle, Vector3.forward) ); Slash slash = slashObj.GetComponent <Slash>(); slash.mov.x = anim.GetFloat("movX"); slash.mov.y = anim.GetFloat("movY"); } }
void SlashAttack() { AnimatorStateInfo stateInfo = anim.GetCurrentAnimatorStateInfo(0); bool loading = stateInfo.IsName("Player_Slash"); if (Input.GetKeyDown(KeyCode.LeftAlt) && manabar.Usable(20)) { anim.SetTrigger("loading"); aura.AuraStart(); } else if (Input.GetKeyUp(KeyCode.LeftAlt) && manabar.Usable(20)) { anim.SetTrigger("attacking"); if (aura.IsLoaded()) { float angle = Mathf.Atan2(anim.GetFloat("movY"), anim.GetFloat("movX")) * Mathf.Rad2Deg; GameObject slashObj = Instantiate(slashPrefab, transform.position, Quaternion.AngleAxis(angle, Vector3.forward)); Slash slash = slashObj.GetComponent <Slash>(); slash.mov.x = anim.GetFloat("movX"); slash.mov.y = anim.GetFloat("movY"); manabar.Gastar(20); } aura.AuraStop(); StartCoroutine(EnableMovementAfter(0.4f)); } if (loading) { movePrevent = true; } }
/// <summary> /// Den här metoden sköter ability2 /// </summary> /// <returns></returns> protected override Ability CastAbility2() { Ability ability = new Slash(TextureBank.mageSpellList[1], pos, LastDirection, this); Ability2CooldownTimer = ability.coolDownTime; return(ability); }
void ataqueCargado() { stateInfoAtaqueCargado = anim.GetCurrentAnimatorStateInfo(0); atacando = stateInfoAtaqueCargado.IsName("Jugador_Slash"); if (Input.GetKeyDown(KeyCode.LeftAlt)) { anim.SetTrigger("cargando"); movePrevent = true; aura.AuraStart(); } else { if (Input.GetKeyUp(KeyCode.LeftAlt)) { anim.SetTrigger("atacando"); if (aura.IsLoaded()) { angulo = Mathf.Atan2(anim.GetFloat("movY"), anim.GetFloat("movX")) * Mathf.Rad2Deg; slashObj = Instantiate(slashCargado, transform.position, Quaternion.AngleAxis(angulo, Vector3.forward)); slash = slashObj.GetComponent <Slash>(); slash.mov.x = anim.GetFloat("movX"); slash.mov.y = anim.GetFloat("movY"); } aura.AuraStop(); StartCoroutine(habilitarMovimiento(0.2f)); } } }
void Start() { animations = GetComponent <Animator>(); spriteController = GetComponent <SpriteRenderer>(); // initiates stats TotalHp = baseHp; TotalAttack = baseAttack; CurrentHp = TotalHp; EnableMovement = true; EnableAttack = true; // initial positioning spawnPoint = GameObject.Find("GladiatorSpawn").transform; transform.position = new Vector2(spawnPoint.position.x, spawnPoint.position.y); position = transform.position; newPosition = position; // creates all the skills slashSkill = new Slash(slashButton, slash); whirlingSkill = new Whirling(whirlingButton, whirling); sonicSkill = new Sonic(sonicButton, sonic); defendSkill = new Defend(defendButton, defend); blindingSkill = new Blinding(blindingButton, blinding); }
private void OnTriggerEnter2D(Collider2D collision) { GameObject other = collision.gameObject; if (other.layer == LayerMask.NameToLayer("PlayerAttacks")) { Slash attack = other.GetComponent <Slash>(); if (attack == null) { Debug.LogError("Colliding Object does not have Attack script", other); } RegisterDamage(attack.damage); Vector3 playerDirection = transform.position - Player.transform.position; if (attack.slashType == SlashType.Melee) { anim.SetTrigger("Attacked"); Knockback(playerDirection); } if (playerDirection.x < 0 && !facingRight || playerDirection.x > 0 && facingRight) { flipDir(); RaiseHope(); } } }
/// <summary> /// Den här metoden sköter ability2 /// </summary> /// <returns></returns> protected override Ability CastAbility2() { Ability ability = new Slash(TextureBank.mageSpellList[1], pos, LastDirection, this); Ability2CooldownTimer = ability.coolDownTime; SoundBank.SoundEffectList[4].Play(0.2f, 0.0f, 0.0f); return(ability); }
public void StartsWith() { Assert.IsTrue(Slash.StartsWith(@"/Yes, it does.")); Assert.IsTrue(Backslash.StartsWith(@"\Yes, it does.")); Assert.IsFalse(Slash.StartsWith("Nope.")); Assert.IsFalse(Backslash.StartsWith("Nope.")); }
public void Join() { Assert.AreEqual(@"One/Two/Three", Slash.Join(new[] { "One", "Two", "Three" })); Assert.AreEqual(@"One\Two\Three", Backslash.Join(new[] { "One", "Two", "Three" })); Assert.AreEqual("Nothing to join.", Slash.Join(new[] { "Nothing to join." })); Assert.AreEqual("Nothing to join.", Backslash.Join(new[] { "Nothing to join." })); }
public void TrimEnd() { Assert.AreEqual("Where're my slashes?", Slash.TrimEnd(@"Where're my slashes?/")); Assert.AreEqual("Where're my backslashes?", Backslash.TrimEnd(@"Where're my backslashes?\")); Assert.AreEqual("Nothing to trim.", Slash.TrimEnd("Nothing to trim.")); Assert.AreEqual("Nothing to trim.", Backslash.TrimEnd("Nothing to trim.")); }
public void TrimStart() { Assert.AreEqual("Where're my slashes?", Slash.TrimStart(@"/Where're my slashes?")); Assert.AreEqual("Where're my backslashes?", Backslash.TrimStart(@"\Where're my backslashes?")); Assert.AreEqual("Nothing to trim.", Slash.TrimStart("Nothing to trim.")); Assert.AreEqual("Nothing to trim.", Backslash.TrimStart("Nothing to trim.")); }
public void EndsWith() { Assert.IsTrue(Slash.EndsWith(@"Yes, it does./")); Assert.IsTrue(Backslash.EndsWith(@"Yes, it does.\")); Assert.IsFalse(Slash.EndsWith("Nope.")); Assert.IsFalse(Backslash.EndsWith("Nope.")); }
public void slashMaker() { GameObject slash = Instantiate(Resources.Load("Prefabs/Slash", typeof(GameObject)), transform.position, Quaternion.identity) as GameObject; Slash s = slash.GetComponent("Slash") as Slash; s.prepSlash(this, slash); //slash.transform.Translate(s.cast(),Space.World); spells [0] = slash; // Debug.Log("-.-"); }
public void JoinTrimming() { Assert.AreEqual(@"One/Two/Three", Slash.JoinTrimming("/One", "Two/", "/Three/")); Assert.AreEqual(@"One\Two\Three", Backslash.JoinTrimming(@"\One", @"Two\", @"\Three\")); Assert.AreEqual("Nothing to join.", Slash.JoinTrimming("Nothing to join.")); Assert.AreEqual("Nothing to join.", Backslash.JoinTrimming("Nothing to join.")); }
// Start is called before the first frame update void Start() { _slash = GetComponent <Slash>(); _playerDir = true; _rolling = false; _animator = GetComponent <Animator>(); _phyo = GetComponent <PhysicsObject>(); }
public override void draw(SpriteBatch sprite_batch, Vector2 draw_offset = default(Vector2)) { Name.draw(sprite_batch, draw_offset - ((this.loc + draw_vector()) + new Vector2(16, 0) - offset)); Uses.draw(sprite_batch, draw_offset - ((this.loc + draw_vector()) + new Vector2(112, 0) - offset)); Slash.draw(sprite_batch, draw_offset - ((this.loc + draw_vector()) + new Vector2(160, 0) - offset)); Use_Max.draw(sprite_batch, draw_offset - ((this.loc + draw_vector()) + new Vector2(200, 0) - offset)); Convoy.draw(sprite_batch, draw_offset - ((this.loc + draw_vector()) + new Vector2(232, 0) - offset)); Icon.draw(sprite_batch, draw_offset - ((this.loc + draw_vector()) - offset)); }
public Knight(Texture2D tex, Vector2 pos, int playerIndex, Controller Controller) : base(tex, pos, playerIndex, Controller) { HealthPoints = ValueBank.KnightHealth; MaxHealthPoints = HealthPoints; Ability1 = new Block(TextureBank.roomTextureList[0], pos, LastDirection, this); Ability2 = new Slash(TextureBank.mageSpellList[1], pos, LastDirection, this); Ability3 = new Taunt(TextureBank.mageSpellList[10], pos, new Vector2(0, 0), this); }
public Barbarian(Texture2D tex, Vector2 pos, int playerIndex, Controller controller) : base(tex, pos, playerIndex, controller) { HealthPoints = ValueBank.BarbarianHealth; MaxHealthPoints = HealthPoints; Ability1 = new Cleave(TextureBank.mageSpellList[6], pos, LastDirection, this); Ability2 = new Slash(TextureBank.mageSpellList[1], pos, LastDirection, this); Ability3 = new Charge(tex, pos, new Vector2(0, 0), this, false); }
public override bool Activate(Entity origin, Entity target) { Slash s = Instantiate(slashPrefab.gameObject, origin.Center, origin.transform.rotation).GetComponent <Slash>(); s.Fire(origin, target, range, lingeringDuration, () => { target.DealDamage(damage + origin.Attack, origin); }); return(true); }
public override void set_text_color(bool useable) { change_text_color(useable ? "White" : "Grey"); string color = useable ? "Blue" : "Grey"; Uses.SetColor(Global.Content, color); Slash.SetColor(Global.Content, color); Use_Max.SetColor(Global.Content, color); }
public override void set_text_color(bool useable) { base.set_text_color(useable); string fontColor = useable ? "Blue" : "Grey"; Uses.SetColor(Global.Content, fontColor); Slash.SetColor(Global.Content, fontColor); Use_Max.SetColor(Global.Content, fontColor); }
sealed public override void update() { base.update(); Uses.update(); Slash.update(); Use_Max.update(); UpdateSprites(); }
public override void draw(SpriteBatch sprite_batch, Vector2 draw_offset) { if (Uses != null) { Uses.draw(sprite_batch, draw_offset - ((this.loc + draw_vector()) + new Vector2(96, 0) - offset)); Slash.draw(sprite_batch, draw_offset - ((this.loc + draw_vector()) + new Vector2(97, 0) - offset)); Use_Max.draw(sprite_batch, draw_offset - ((this.loc + draw_vector()) + new Vector2(120, 0) - offset)); } base.draw(sprite_batch, draw_offset); }
public SlashRendererInformation(Slash slash) { var texture = SimulationGame.ContentManager.Load <Texture2D>(@"Spells\Slash\Slash"); var sheet = new Spritesheet.Spritesheet(texture).WithFrameEffect(slash.Flipped ? SpriteEffects.FlipHorizontally : SpriteEffects.None).WithGrid((64, 64)).WithCellOrigin(new Point(32, 32)).WithFrameDuration(slash.Duration.TotalMilliseconds / 5); slashAnimation = sheet.CreateAnimation((0, 0), (1, 0), (2, 0), (3, 0), (4, 0)); slashAnimation.Start(Repeat.Mode.Once); Angle = slash.Flipped ? slash.Angle - 0.5f * (float)Math.PI : slash.Angle; }
public Sword() { name = "Sword"; damage = 1; coldDown = 0.3f; energy = 6; weight = 1.0f; graphic = Resources.Load <Sprite>("Sprites/Weapon_Sprites/Sword_sprite"); action_A = new Slash(); action_B = new Slash(); }
public Sword() { name = "Sword"; damage = 1; coldDown = 0.3f; energy = 6; weight = 1.0f; graphic = Resources.Load<Sprite>("Sprites/Weapon_Sprites/Sword_sprite"); action_A = new Slash(); action_B = new Slash(); }