Exemplo n.º 1
0
    public override float eventStart()
    {
        foreach (var buff in owner.effectList)
        {
            if (buff.modificator != null)
            {
                buff.modificator.owner  = owner;
                buff.modificator.target = target;
                buff.modificator.updateMakingDamage(ability);
            }
        }

        foreach (var buff in target.effectList)
        {
            if (buff.modificator != null)
            {
                buff.modificator.owner  = target;
                buff.modificator.target = owner;
                buff.modificator.updateGettingDamage(ability);
            }
        }

        float value = target.damage(ability);

        owner.statistics.damageDealed += value;
        owner.updateAgro(owner.agro + 1);
        target.updateAgro(target.agro - 1);

        logEvent(" deal " + value + " to " + target.name + "[" + target.health + "/" + target.maxHealth + "]");

        if (value > 0)
        {
            if (ability.hasAttribute(EffectAttribures.MAGIC_SHIELD))
            {
                target.personController.magicShieldTrigger();
            }
            else if (ability.hasAttribute(EffectAttribures.BLOCK))
            {
                target.personController.blockTrigger();
            }
            else
            {
                target.personController.hittenTrigger();
            }
            return(eventDuration);
        }

        if (!target.isAlive)
        {
            logEvent(" kill " + target.name);
            CSVLogger.log(eventTime, owner.name, GetType().ToString(), owner.name + " kill " + target.name);
        }

        return(0.0f);
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        base.Update();

        if (isActive)
        {
            if (PartiesSingleton.hasWinner())
            {
                CSVLogger.log(EventQueueSingleton.queue.nextEventTime, "FightController", "FightController", "Result");
                foreach (var hero in PartiesSingleton.heroes.getLivePersons())
                {
                    CSVLogger.log(EventQueueSingleton.queue.nextEventTime, "FightController", "FightController", hero.name + "has " + hero.health);
                }

                foreach (var hero in PartiesSingleton.enemies.getLivePersons())
                {
                    CSVLogger.log(EventQueueSingleton.queue.nextEventTime, "FightController", "FightController", hero.name + "has " + hero.health);
                }
                isFinished = true;

                openFightResult();
            }
            else
            {
                if (!EventQueueSingleton.queue.fastFight)
                {
                    string result = EventQueueSingleton.queue.startEvent(Time.fixedTime);
                    if (result.Length > 0)
                    {
                        eventLog.GetComponent <Text>().text = result;
                        displayEvents(EventQueueSingleton.queue.events);
                    }
                }
            }
        }
    }
Exemplo n.º 3
0
 public void userLogEvent(string message)
 {
     CSVLogger.log(eventTime, "user", GetType().ToString(), message);
 }
Exemplo n.º 4
0
 public void logEvent(string message)
 {
     CSVLogger.log(eventTime, owner.name, GetType().ToString(), message);
 }