private void OnAttacked(EntityUid uid, ArtifactHeatTriggerComponent component, AttackedEvent args)
 {
     if (!component.ActivateHotItems || !CheckHot(args.Used))
     {
         return;
     }
     _artifactSystem.TryActivateArtifact(uid, args.User);
 }
Пример #2
0
    public void AttackedFunc(GameObject attacker, GameObject target, int unitNum = 999)
    {
        List <GameObject> unitList = LandManager.instance.GetComponent <UnitManager>().unitList;

        if (AttackedEvent != null)
        {
            foreach (Attacked d in AttackedEvent.GetInvocationList())
            {
                string unitID = HarimTool.EditValue.EditText.Left(d.Target.ToString(), 4);
                //Debug.Log(attacker.name+", "+target.name+", "+ unitID);
                if (LandManager.instance.GetComponent <UnitManager>().SearchUnit(unitID) != null)
                {
                    if (LandManager.instance.GetComponent <UnitManager>().SearchUnit(unitID).transform.parent.parent.gameObject.activeSelf == true)
                    {
                        if (unitID == target.name && attacker.name != target.name)
                        {
                            TempAttackedEvent += d;
                        } //UnitID로 맞는놈이랑 확인했는데, 때리는놈이랑 맞는놈이 다르면,  Event를 임시보관한다.
                    }     //찾은 게임오브젝트가 active true이고,
                }         //찾는 게임오브젝트가 있고,
            }
        }
        try
        {
            if (TempAttackedEvent != null)
            {
                //Debug.Log("AttackEvent0 : "+ TempAttackedEvent.GetInvocationList().Length);
                TempAttackedEvent(attacker, target, unitNum);
                foreach (Attacked d in TempAttackedEvent.GetInvocationList())
                {
                    TempAttackedEvent -= d;
                }                                                                                        //임시보관 초기화.
            }
        }
        catch { Debug.Log("Error_AttackEvent"); }
    }
Пример #3
0
 private void Awake()
 {
     onAttacked = new AttackedEvent();
     onDied     = new AttackedEvent();
     nowHP      = hp;
 }
        private void OnElectrifiedAttacked(EntityUid uid, ElectrifiedComponent electrified, AttackedEvent args)
        {
            if (!electrified.OnAttacked)
            {
                return;
            }

            TryDoElectrifiedAct(uid, args.User, 1, electrified);
        }
    private void OnAttack(EntityUid uid, ArtifactInteractionTriggerComponent component, AttackedEvent args)
    {
        if (!component.AttackActivation)
        {
            return;
        }

        _artifactSystem.TryActivateArtifact(uid, args.User);
    }