Esempio n. 1
0
 private void OnTriggerEnter(Collider coll)
 {
     Debug.Log(coll.tag);
     if (coll.tag.Equals("Enemy"))
     {
         CreatorKitCode.CharacterData     target = coll.GetComponent <CreatorKitCode.CharacterData>();
         CreatorKitCode.Weapon.AttackData daño   = new CreatorKitCode.Weapon.AttackData(target);
         daño.AddDamage(CreatorKitCode.StatSystem.DamageType.Electric, 2);
         target.Damage(daño);
         Destroy(gameObject);
     }
 }
Esempio n. 2
0
 //called after all weapon effect where applied, allow to react to the total amount of damage applied
 public virtual void OnPostAttack(CharacterData target, CharacterData user, AttackData data)
 {
 }
Esempio n. 3
0
 /// <summary>
 /// Build a new AttackData. All AttackData need a target, but source is optional. If source is null, the
 /// damage is assume to be from a non CharacterData source (elemental effect, environment) and no boost will
 /// be applied to damage (target defense is still taken in account).
 /// </summary>
 /// <param name="target"></param>
 /// <param name="source"></param>
 public AttackData(CharacterData target, CharacterData source = null)
 {
     m_Target = target;
     m_Source = source;
 }
Esempio n. 4
0
 /// <summary>
 /// Will check if that CharacterData can reach the given target with its currently equipped weapon. Will rarely
 /// be called, as the function CanAttackTarget will call this AND also check if the cooldown is finished.
 /// </summary>
 /// <param name="target">The CharacterData you want to reach</param>
 /// <returns>True if you can reach the target, False otherwise</returns>
 public bool CanAttackReach(CharacterData target)
 {
     return(Equipment.Weapon.CanHit(this, target));
 }
Esempio n. 5
0
 //return the amount of physical damage. If no change, just return physicalDamage passed as parameter
 public virtual void OnAttack(CharacterData target, CharacterData user, ref AttackData data)
 {
 }
 public abstract void InteractWith(CharacterData target);
Esempio n. 7
0
 /// <summary>
 /// Attack the given target. NOTE : this WON'T check if the target CAN be attacked, you should make sure before
 /// with the CanAttackTarget function.
 /// </summary>
 /// <param name="target">The CharacterData you want to attack</param>
 public void Attack(CharacterData target)
 {
     Equipment.Weapon.Attack(this, target);
 }
 public void Init(CharacterData owner)
 {
     m_Owner = owner;
 }
 public void InitWeapon(Weapon wep, CharacterData data)
 {
     m_DefaultWeapon = wep;
 }
Esempio n. 10
0
 public virtual void Applied(CharacterData target)
 {
     m_Timer  = m_Duration;
     m_Target = target;
 }
Esempio n. 11
0
 /// <summary>
 /// Called by the inventory system when the object is "used" (double clicked)
 /// </summary>
 /// <param name="user">The CharacterDate that used that item</param>
 /// <returns>If it was actually used (allow the inventory to know if it can remove the object or not)</returns>
 public virtual bool UsedBy(CharacterData user)
 {
     return(false);
 }
Esempio n. 12
0
 public override void InteractWith(CharacterData target)
 {
     m_LootSpawner.SpawnLoot();
     Destroy(this);
 }
Esempio n. 13
0
 public void Init(CharacterData owner)
 {
     stats.Copy(baseStats);
     CurrentHealth = stats.health;
     m_Owner       = owner;
 }
Esempio n. 14
0
 //return true if could be used, false otherwise.
 public abstract bool Use(CharacterData user);
Esempio n. 15
0
 public abstract void Removed(CharacterData user);
Esempio n. 16
0
 //return true if could be used, false otherwise.
 public abstract void Equipped(CharacterData user);