public void Apply_NotACharacter_Test() { var entity = Mock.Of <IEntity>(); var blinded = new Blinded(); blinded.Apply(entity); Assert.IsTrue(true); // If we made it here with exception then the test passed }
public Distracting(Entity abilityOwner) : base("Distracting", "Anyone adjacent is Blinded.", -1, 1, abilityOwner, TargetType.Friendly, true) { _blindedTiles = new List <Tile>(); _blindedEffect = new Blinded(abilityOwner, true, Blinded.INFINITE); var eventMediator = Object.FindObjectOfType <EventMediator>(); eventMediator.SubscribeToEvent(GlobalHelper.ActiveEntityMoved, this); }
public void Apply_Character_WithExistingBlindedCondition_Test() { var character = CreateMockCharacter(); character.Conditions.Add(new Blinded()); var blinded = new Blinded(); blinded.Apply(character); }
public void ExtensionMethod_IList_IConditions_GetById_ClassConversion_ThrowsException_Test() { var conditionList = new List <ICondition>(); var blinded = new Blinded(); conditionList.Add(blinded); var condition = conditionList.GetById <Wounded>(EntityIds.BLINDED_CONDITION_ID); Assert.AreSame(blinded, condition); }
public void ExtensionMethod_IList_IConditions_GetById_ReturnsCondition_Test() { var conditionList = new List <ICondition>(); var blinded = new Blinded(); conditionList.Add(blinded); var condition = conditionList.GetById(EntityIds.BLINDED_CONDITION_ID); Assert.AreSame(blinded, condition); }
public void Remove_NoOtherConditions_Test() { var character = CreateMockCharacter(); var blinded = new Blinded(); blinded.Apply(character); blinded.Remove(character); Assert.AreEqual(0, character.Conditions.Count); Assert.AreEqual(0, character.Immunities.Count); }
public void Apply_Character_NoConditions_Test() { var character = CreateMockCharacter(); var blinded = new Blinded(); blinded.Apply(character); Assert.AreSame(blinded, character.Conditions[0]); Assert.AreEqual(ConditionGroup.Senses, character.Conditions[0].Group); Assert.AreEqual(EntityIds.VISUAL_TRAIT_ID, character.Immunities[0].Id); }
public void Apply_Character_DoesNotApplyWithBlindedCondition_Test() { var character = CreateMockCharacter(); var blinded = new Blinded(); blinded.Apply(character); var dazzled = new Dazzled(); dazzled.Apply(character); Assert.AreEqual(1, character.Conditions.Count); Assert.AreSame(blinded, character.Conditions[0]); }
public void Start() { gameInstance = this; Controls.Setup(); this.hoveredActionnable = null; this.cameraController = new CameraController(this.cam, this.birdObject, this.birdSelectionObject); this.blinded = new Blinded(blindedObject); this.rng = new System.Random(); this.SetState(STATE_MAIN_MENU); }
private void RotateBlinded(Blinded blinded, Vector3 move) { GameObject gb = blinded.AsGameObject(); Vector3 forward = gb.transform.forward; Vector3 forwardProj = new Vector3(forward.x, 0, forward.z); float angle = Mathf.Acos(Vector3.Dot(move, forwardProj)) / (float)(2.0f * Math.PI) * 360.0f; this.rotated = angle < 0.5f; if (this.rotated) { return; } float dTheta = 0.250229f * Math.Abs(angle) - 0.00114325f * angle * angle; /** lagrange interpolation */ gb.transform.Rotate(new Vector3(0, Math.Sign(angle) * dTheta, 0.0f)); this.rotated = angle < 1.0f; }
public bool Update(Blinded blinded) { Vector3 d = this.destination - blinded.AsGameObject().transform.position; Vector3 move = new Vector3(d.x, 0, d.z).normalized; bool isWalking = false; if (!this.rotated) { this.RotateBlinded(blinded, move); } else { this.MoveBlinded(blinded, move); isWalking = true; } bool stop = d.magnitude < 0.2f; blinded.GetAnimator().SetBool("blindedIsWalking", isWalking && !stop); return(stop); }
public string[] ToArray() { string[] array = new string[16]; array[0] = Blinded.Equals("Cured") ? "" : "Blinded"; array[1] = Charmed.Equals("Cured") ? "" : "Charmed"; array[2] = Deafened.Equals("Cured") ? "" : "Deafened"; array[3] = Encumbrance.Equals("Normal") ? "" : Encumbrance; array[4] = Fatigued.Equals("Cured") ? "" : Fatigued; array[5] = Frightened.Equals("Cured") ? "" : "Frightened"; array[6] = Grappled.Equals("Cured") ? "" : "Grappled"; array[7] = Incapacitated.Equals("Cured") ? "" : "Incapacitated"; array[8] = Invisible.Equals("Cured") ? "" : "Invisible"; array[9] = Paralyzed.Equals("Cured") ? "" : "Paralyzed"; array[10] = Petrified.Equals("Cured") ? "" : "Petrified"; array[11] = Poisoned.Equals("Cured") ? "" : "Poisoned"; array[12] = Prone.Equals("Cured") ? "" : "Prone"; array[13] = Restrained.Equals("Cured") ? "" : "Restrained"; array[14] = Stunned.Equals("Cured") ? "" : "Stunned"; array[15] = Unconscious.Equals("Cured") ? "" : "Unconscious"; return(array); }
private void MoveBlinded(Blinded blinded, Vector3 move) { float dt = Time.deltaTime; blinded.AsGameObject().transform.position += this.speed * move * dt; }