public void newActorTarget(ObjectActor Target, string name) { effectsObject.SetActive(true); panel.SetActive(true); resetTargetPanel(); TargetActor = Target; TargetCombatable = Target as ObjectCombatable; targetType = 3; TargetName.text = name; queueObject.SetActive(true); targetQueue.setQueue(TargetActor); effects.setList(TargetActor); //if (Player.getWis() >= 20) //{ TargetHealthBarObject.SetActive(true); healthBarSet(true); //if (Player.getWis() >= 30 && Player.getInt() >= 20) //{ TargetEnergyBarObject.SetActive(true); energyBarSet(true); //} //} skillActivationObs = gameObject.AddComponent <IntObserver>(); skillActivationObs.setupObserver(setProgressBar); Target.skillDequeueSubscribe(skillActivationObs); skillCompletionObs = gameObject.AddComponent <IntObserver>(); skillCompletionObs.setupObserver(deactivateProgressBar); Target.skillFinishSubscribe(skillCompletionObs); }
public void removeEnemyIndividual(ObjectCombatable newIndividual) { if (enemyIndividuals.Contains(newIndividual)) { enemyIndividuals.Remove(newIndividual); } }
public virtual void addEnemyIndividual(ObjectCombatable newIndividual) { if (!enemyIndividuals.Contains(newIndividual)) { enemyIndividuals.Add(newIndividual); } }
/* * skillName = "Stab"; * briefSkillDescription = "Target takes 20 piercing damage."; * fullSkillDescription = "Target is struck from up to 3.5 meters away for 20 piercing damage."; * energyCost = 5.0f; * sacrificeCost = 0.02f; * adrenalineCost = 1; * castTime = 0.2f; * cooldown = 5.5f; * range = 3.5f; */ public override bool activate(ObjectActor self, ObjectCombatable target, out string message) { float damage = self.getStr() * 0.5f + 10.0f; target.takePiercingDamage(damage, (ObjectInteractable)self); message = ""; return(false); }
public void playerTriggerSkill(int index) { ObjectCombatable combatableTarget = (ObjectCombatable)selectedObject; if (combatableTarget != null) { actorSelf.skillEnqueue(index, combatableTarget); } }
/* * skillName = "Exact Slash"; * briefSkillDescription = "Target suffers bleeding."; * fullSkillDescription = "Target suffers bleeding for 10 seconds."; * energyCost = 10.0f; * sacrificeCost = 0.0f; * adrenalineCost = 0; * castTime = 0.5f; * cooldown = 1.5f; * range = 3.0f; */ public override void activate(ObjectActor self, ObjectCombatable target) { ObjectActor targetActor = target as ObjectActor; if (targetActor != null) { targetActor.beginBleed(self); } }
public override void activate(ObjectActor self, ObjectCombatable target) { ObjectActor targetActor = target as ObjectActor; target.takeColdDamage(10.0f, self); if (targetActor != null) { targetActor.beginChilled(self); } }
/* * skillName = "Exact Slash"; * briefSkillDescription = "Target suffers bleeding."; * fullSkillDescription = "Target suffers bleeding for 10 seconds."; * energyCost = 10.0f; * sacrificeCost = 0.0f; * adrenalineCost = 0; * castTime = 0.5f; * cooldown = 1.5f; * range = 3.0f; */ public override bool activate(ObjectActor self, ObjectCombatable target, out string message) { ObjectActor targetActor = target as ObjectActor; if (targetActor != null) { targetActor.beginBleeding(self); } message = ""; return(false); }
public override bool activate(ObjectActor self, ObjectCombatable target, out string message) { ObjectActor targetActor = target as ObjectActor; target.takeColdDamage(10.0f, self); if (targetActor != null) { targetActor.beginChilled(self); } message = ""; return(false); }
public override void addEnemyIndividual(ObjectCombatable newIndividual) { base.addEnemyIndividual(newIndividual); ObjectActor actor = (ObjectActor)newIndividual; if (actor != null) { foreach (BasicMotivator unit in motivatorUnits) { unit.newTargetIndividual(actor); } } }
public void Deactivate() { TargetActor = null; TargetCombatable = null; TargetInteractable = null; targetType = 0; TargetName.text = ""; panel.SetActive(false); TargetHealthBarObject.SetActive(false); if (queueObject != null) { queueObject.SetActive(false); } }
public override void activate(ObjectActor self, ObjectCombatable target) { target.takePiercingDamage(10.0f, (ObjectInteractable)self); float damage; if (target.gameObject.GetComponent <BleedEffect>() != null) { damage = self.getStr() * 0.5f + 40.0f; } else { damage = self.getStr() * 0.5f; } target.takePoisonDamage(damage, (ObjectInteractable)self); }
public override void activate(ObjectActor self, ObjectCombatable target) { float num = target.getPercentHealth(); if (num < 0.25f) { float damage = self.getStr() * 0.5f + 50.0f; target.takeSlashingDamage(damage, (ObjectInteractable)self); } else if (num < 0.5f) { float damage = self.getStr() * 0.5f + 30.0f; target.takeSlashingDamage(damage, (ObjectInteractable)self); } }
public void newCombatableTarget(ObjectCombatable Target, string name) { effectsObject.SetActive(false); panel.SetActive(true); resetTargetPanel(); this.TargetCombatable = Target; targetType = 2; TargetName.text = name; TargetHealthBarObject.SetActive(true); //if (Player.getWis() >= 20) //{ TargetHealthBarObject.SetActive(true); healthBarSet(true); //} TargetEnergyBarObject.SetActive(false); }
public override bool activate(ObjectActor self, ObjectCombatable target, out string message) { target.takePiercingDamage(10.0f, (ObjectInteractable)self); float damage; if (target.gameObject.GetComponent <BleedEffect>() != null) { damage = self.getStr() * 0.5f + 40.0f; } else { damage = self.getStr() * 0.5f; } target.takePoisonDamage(damage, (ObjectInteractable)self); message = ""; return(false); }
public override void activate(ObjectActor self, ObjectCombatable target) { ObjectActor targetActor = target as ObjectActor; ObjectInteractable source = self as ObjectInteractable; if (targetActor != null) { GloriousDawn preexisting = target.gameObject.GetComponent <GloriousDawn>(); if (preexisting == null) { GloriousDawn regeneration = target.gameObject.AddComponent <GloriousDawn>(); regeneration.setup(targetActor, source, skillName, briefSkillDescription, duration, stackHealing); targetActor.applyNewEffect(regeneration); } else { preexisting.stack(); } } }
public override void activate(ObjectActor self, ObjectCombatable target) { ObjectActor targetActor = target as ObjectActor; ObjectInteractable source = self as ObjectInteractable; if (targetActor != null) { BarnardsExaltation preexisting = target.gameObject.GetComponent <BarnardsExaltation>(); if (preexisting == null) { BarnardsExaltation regeneration = target.gameObject.AddComponent <BarnardsExaltation>(); regeneration.setup(targetActor, source, skillName, briefSkillDescription, duration, REGENSPEED, DEGENSPEED); targetActor.applyNewEffect(regeneration); } else { preexisting.stack(); } } }
public override void activate(ObjectActor self, ObjectCombatable target) { //Debug.Log(energyCost); ObjectActor targetActor = target as ObjectActor; ObjectInteractable source = self as ObjectInteractable; if (targetActor != null) { CyphersPoisonSkill preexisting = target.gameObject.GetComponent <CyphersPoisonSkill>(); if (preexisting == null) { CyphersPoisonSkill cyphers = target.gameObject.AddComponent <CyphersPoisonSkill>(); cyphers.setup(targetActor, source, skillName, briefSkillDescription, duration, damage); targetActor.applyNewEffect(cyphers); } else { preexisting.stack(); } } }
public override bool activate(ObjectActor self, ObjectCombatable target, out string message) { ObjectActor actor = (ObjectActor)target; if (actor != null) { actor.beginBleeding(self); actor.beginBurning(self); actor.beginChilled(self); actor.beginConcussed(self); actor.beginCrippled(self); actor.beginExhausted(self); actor.beginPoisoned(self); actor.beginScarred(self); actor.beginShattered(self); actor.beginWeakened(self); actor.beginWounded(self); } message = ""; return(false); }
public override void activate(ObjectActor self, ObjectCombatable target) { //Debug.Log(energyCost); ObjectActor targetActor = target as ObjectActor; ObjectInteractable source = self as ObjectInteractable; if (targetActor != null) { Shield preexisting = target.gameObject.GetComponent <Shield>(); if (preexisting == null) { Shield effect = target.gameObject.AddComponent <Shield>(); effect.setup(targetActor, source, skillName, briefSkillDescription, duration, value); targetActor.applyNewEffect(effect); } else { preexisting.stack(); } } }
public override bool activate(ObjectActor self, ObjectCombatable target, out string message) { float num = target.getPercentHealth(); if (num < 0.25f) { float damage = self.getStr() * 0.5f + 50.0f; target.takeSlashingDamage(damage, (ObjectInteractable)self); } else if (num < 0.5f) { float damage = self.getStr() * 0.5f + 30.0f; target.takeSlashingDamage(damage, (ObjectInteractable)self); } else { message = "Target's health was not low enough."; return(true); } message = ""; return(false); }
public override bool activate(ObjectActor self, ObjectCombatable target, out string message) { ObjectActor targetActor = target as ObjectActor; ObjectInteractable source = self as ObjectInteractable; if (targetActor != null) { GrennsFire preexisting = target.gameObject.GetComponent <GrennsFire>(); if (preexisting == null) { GrennsFire grennsFire = target.gameObject.AddComponent <GrennsFire>(); grennsFire.setup(targetActor, source, skillName, briefSkillDescription, duration, DEGENSPEED); targetActor.applyNewEffect(grennsFire); targetActor.beginBurning(self); } else { preexisting.stack(); } } message = ""; return(false); }
public override bool activate(ObjectActor self, ObjectCombatable target, out string message) { ObjectActor targetActor = target as ObjectActor; ObjectInteractable source = self as ObjectInteractable; sourceActor = self; if (targetActor != null) { DelayedJolt preexisting = target.gameObject.GetComponent <DelayedJolt>(); if (preexisting == null) { DelayedJolt regeneration = target.gameObject.AddComponent <DelayedJolt>(); regeneration.setup(targetActor, source, sourceActor, skillName, briefSkillDescription, duration); targetActor.applyNewEffect(regeneration); } else { preexisting.stack(); } } message = ""; return(false); }
public void newActorTarget(ObjectActor Target, string name) { effectsObject.SetActive(true); panel.SetActive(true); resetTargetPanel(); this.TargetActor = Target; this.TargetCombatable = Target as ObjectCombatable; targetType = 3; TargetName.text = name; queueObject.SetActive(true); targetQueue.setQueue(TargetActor); effects.setList(TargetActor); //if (Player.getWis() >= 20) //{ TargetHealthBarObject.SetActive(true); healthBarSet(true); //if (Player.getWis() >= 30 && Player.getInt() >= 20) //{ TargetEnergyBarObject.SetActive(true); energyBarSet(true); //} //} }
// activate returns true if a message is needed due to something happening. // An example is a condition for a skill being activated is not met. The message string is filled // with the text to be shown to the player. public abstract bool activate(ObjectActor self, ObjectCombatable target, out string message);
public abstract void activate(ObjectActor self, ObjectCombatable target);
private void Update() { //selection handler Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit)) { Object ObjectHit = hit.collider.GetComponent <Object>(); ObjectInteractable interactableObjectHit = hit.collider.GetComponent <ObjectInteractable>(); ObjectCombatable CombatableObjectHit = hit.collider.GetComponent <ObjectCombatable>(); ObjectActor ActorObjectHit = hit.collider.GetComponent <ObjectActor>(); if ((interactableObjectHit != null) && !EventSystem.current.IsPointerOverGameObject()) { /* * Really need to start documenting this earlier in the process. * * * This bit is handling highlighting and dehighlighting as the mouse passes over something. */ if (interactableObjectHit != selectedObject) { if (highlightedObject == null) { interactableObjectHit.beingHighlighted(true); highlightedObject = interactableObjectHit; } else { highlightedObject.beingHighlighted(false); highlightedObject = interactableObjectHit; highlightedObject.beingHighlighted(true); } } /* * This handles the player's selection and reselection system. */ if (Input.GetMouseButtonDown(0)) { if (selectedObject != interactableObjectHit) { if (selectedObject != null) { selectedObject.beingSelected(false); } interactableObjectHit.beingSelected(true); selectedObject = interactableObjectHit; highlightedObject = null; string name = ObjectHit.name; if (ActorObjectHit != null) { TargetPanel.Instance.newActorTarget(ActorObjectHit, name); } else if (CombatableObjectHit != null) { TargetPanel.Instance.newCombatableTarget(CombatableObjectHit, name); } else { TargetPanel.Instance.newInteractableTarget(interactableObjectHit, name); } } } } else if (highlightedObject != null && (EventSystem.current.IsPointerOverGameObject() || hit.collider.tag == "Terrain")) { highlightedObject.beingHighlighted(false); highlightedObject = null; } //movement if (Input.GetMouseButton(0) && hit.collider.gameObject.tag == "Terrain" && !EventSystem.current.IsPointerOverGameObject() && !actorSelf.getDeathState() && !dragAndDrop) { navAgent.stoppingDistance = defaultStoppingDist; navAgent.SetDestination(hit.point); if (Input.GetButton("Shift")) { //MoveAction newAction = new MoveAction(hit.point); //ActionQueue.Instance.Enqueue(newAction); } } } else if (highlightedObject != null) { highlightedObject.beingHighlighted(false); highlightedObject = null; } PlayerHealthBar.value = actorSelf.getPercentHealth(); PlayerHealthNum.text = Mathf.Round(actorSelf.getCurrentHealth()).ToString(); PlayerEnergyBar.value = actorSelf.getPercentEnergy(); PlayerEnergyNum.text = Mathf.Round(actorSelf.getCurrentEnergy()).ToString(); if (actorSelf.getSkillActivating() && !lastUpdateActivationState) { PlayerProgressBar.setActive(true); PlayerProgressBar.setName(actorSelf.getNameOfSkillInProgress()); PlayerProgressBar.placeIcon(actorSelf.getReferenceToSkillInProgress()); } else if (actorSelf.getSkillActivating() && lastUpdateActivationState) { PlayerProgressBar.setPercent(actorSelf.getSkillProgress()); } else { PlayerProgressBar.removeIcon(); PlayerProgressBar.setActive(false); } lastUpdateActivationState = actorSelf.getSkillActivating(); if (Input.GetKeyDown(KeyCode.Alpha1)) { playerTriggerSkill(0); } else if (Input.GetKeyDown(KeyCode.Alpha2)) { playerTriggerSkill(1); } else if (Input.GetKeyDown(KeyCode.Alpha3)) { playerTriggerSkill(2); } else if (Input.GetKeyDown(KeyCode.Alpha4)) { playerTriggerSkill(3); } else if (Input.GetKeyDown(KeyCode.Alpha5)) { playerTriggerSkill(4); } else if (Input.GetKeyDown(KeyCode.Alpha6)) { playerTriggerSkill(5); } else if (Input.GetKeyDown(KeyCode.Alpha7)) { playerTriggerSkill(6); } else if (Input.GetKeyDown(KeyCode.Alpha8)) { playerTriggerSkill(7); } }
/* * skillName = "Stab"; * briefSkillDescription = "Target takes 20 piercing damage."; * fullSkillDescription = "Target is struck from up to 3.5 meters away for 20 piercing damage."; * energyCost = 5.0f; * sacrificeCost = 0.02f; * adrenalineCost = 1; * castTime = 0.2f; * cooldown = 5.5f; * range = 3.5f; */ public override void activate(ObjectActor self, ObjectCombatable target) { float damage = self.getStr() * 0.5f + 10.0f; target.takePiercingDamage(damage, (ObjectInteractable)self); }