Beispiel #1
0
    public static AIBaseData GetActorIsInitAIDataList(Actor actor, string name = "")
    {
        AIBaseData tmpData = AIBaseData.CreateAIBaseData(AIBaseData.DataType.enBool);

        tmpData.SetBoolValue(actor.IsInitAIDataList);
        return(tmpData);
    }
Beispiel #2
0
    public static AIBaseData GetActorCurTarget(Actor actor, string name = "")
    {
        AIBaseData tmpData = AIBaseData.CreateAIBaseData(AIBaseData.DataType.enBool);

        tmpData.SetBoolValue(actor.CurrentTargetIsDead);
        return(tmpData);
    }
Beispiel #3
0
    public static AIBaseData GetActorTargetDis(Actor actor, string name = "")
    {
        AIBaseData tmpData = AIBaseData.CreateAIBaseData();

        tmpData.SetFloatValue(ActorTargetManager.GetTargetDistance(actor.RealPos, actor.CurrentTarget.RealPos));
        return(tmpData);
    }
Beispiel #4
0
    public static AIBaseData GetActorHPPercent(Actor actor, string name = "")
    {
        AIBaseData tmpData = AIBaseData.CreateAIBaseData();

        tmpData.SetFloatValue(actor.HP / actor.MaxHP);
        return(tmpData);
    }
Beispiel #5
0
    public static AIBaseData GetTrapIsActorTouch(Actor actor, string name = "")
    {
        Trap       tmpTrap = actor as Trap;
        AIBaseData tmpData = AIBaseData.CreateAIBaseData(AIBaseData.DataType.enBool);

        tmpData.SetBoolValue(tmpTrap.mEnterActorIDList.Count > 0);
        return(tmpData);
    }
Beispiel #6
0
    public static AIBaseData GetTrapMinAttackTime(Actor actor, string name = "")
    {
        Trap       tmpTrap = actor as Trap;
        AIBaseData tmpData = AIBaseData.CreateAIBaseData();

        tmpData.SetFloatValue(tmpTrap.mMinAttackTime);
        return(tmpData);
    }
Beispiel #7
0
    public static AIBaseData GetTrapMaxAttackCount(Actor actor, string name = "")
    {
        Trap       tmpTrap = actor as Trap;
        AIBaseData tmpData = AIBaseData.CreateAIBaseData(AIBaseData.DataType.enInt);

        tmpData.SetIntValue(tmpTrap.mMaxAttackCount);
        return(tmpData);
    }
Beispiel #8
0
    public static AIBaseData GetTrapState(Actor actor, string name = "")
    {
        Trap       tmpTrap = actor as Trap;
        AIBaseData tmpData = AIBaseData.CreateAIBaseData(AIBaseData.DataType.enInt);

        tmpData.SetIntValue((int)tmpTrap.mTrapState);
        return(tmpData);
    }
Beispiel #9
0
    public static AIBaseData GetTrapIsAble(Actor actor, string name = "")
    {
        Trap       tmpTrap = actor as Trap;
        AIBaseData tmpData = AIBaseData.CreateAIBaseData(AIBaseData.DataType.enBool);

        tmpData.SetBoolValue(tmpTrap.m_trapAble);
        return(tmpData);
    }
Beispiel #10
0
 public AIBaseData GetBaseData(string valueName, AIBaseData.DataType valueType)
 {
     if (m_baseDataDic.ContainsKey(valueName))
     {
         return(m_baseDataDic[valueName]);
     }
     else
     {
         AIBaseData tmpAIBaseData = AIBaseData.CreateAIBaseData(valueType);
         m_baseDataDic.Add(valueName, tmpAIBaseData);
         return(tmpAIBaseData);
     }
 }
Beispiel #11
0
    public override void Deserialize(XmlNode xmlNode)
    {
        base.Deserialize(xmlNode);
        XmlElement xmlElement = xmlNode as XmlElement;

        mSourValueType     = xmlElement.GetAttribute("SourValueType");
        mSourValueName     = xmlElement.GetAttribute("SourValueName");
        m_funcGetSourValue = GetValueFunction(mSourValueType, mSourValueName);
        mTarValueType      = xmlElement.GetAttribute("TarValueType");
        mTarValueName      = xmlElement.GetAttribute("TarValueName");
        m_funcGetTarValue  = GetValueFunction(mTarValueType, mTarValueName);
        mValueType         = AIBaseData.ChangeStrToDataType(xmlElement.GetAttribute("ValueType"));
        mCompareType       = AIBaseData.ChangeStrToCompareType(xmlElement.GetAttribute("CompareType"));
        mValue             = AIBaseData.CreateAIBaseData(mValueType);
        mValue.SetValue(xmlElement.GetAttribute("Value"));
    }
Beispiel #12
0
    public override void Deserialize(XmlNode xmlNode)
    {
        base.Deserialize(xmlNode);
        XmlElement xmlElement = xmlNode as XmlElement;

        mObjType   = xmlElement.GetAttribute("ObjectType");
        mValueName = xmlElement.GetAttribute("ValueName");
        if (mObjType == "Actor")
        {
            switch (mValueName)
            {
            case "HP":
                m_funcGetValue = FunctionalFuncBase.GetActorHPValue;
                m_funcSetValue = FunctionalFuncBase.SetActorHPValue;
                break;

            case "IsInitAIDataList":
                m_funcGetValue = FunctionalFuncBase.GetActorIsInitAIDataList;
                m_funcSetValue = FunctionalFuncBase.SetActorIsInitAIDataList;
                break;

            case "TrapIsActive":
                m_funcGetValue = FunctionalFuncBase.GetTrapIsActive;
                m_funcSetValue = FunctionalFuncBase.SetTrapIsActive;
                break;

            case "TrapIsAble":
                m_funcGetValue = FunctionalFuncBase.GetTrapIsAble;
                m_funcSetValue = FunctionalFuncBase.SetTrapIsAble;
                break;

            case "TrapState":
                m_funcGetValue = FunctionalFuncBase.GetTrapState;
                m_funcSetValue = FunctionalFuncBase.SetTrapState;
                break;

            case "TrapMaxAttackCount":
                m_funcGetValue = FunctionalFuncBase.GetTrapMaxAttackCount;
                m_funcSetValue = FunctionalFuncBase.SetTrapMaxAttackCount;
                break;

            case "TrapMinAttackTime":
                m_funcGetValue = FunctionalFuncBase.GetTrapMinAttackTime;
                m_funcSetValue = FunctionalFuncBase.SetTrapMinAttackTime;
                break;

            default:
                break;
            }
        }
        else if (mObjType == "AI")
        {
            m_funcGetValue = null;
            m_funcSetValue = null;
        }
        mValueType = AIBaseData.ChangeStrToDataType(xmlElement.GetAttribute("ValueType"));
        mSetType   = AIBaseData.ChangeStrToSetType(xmlElement.GetAttribute("SetType"));
        mValue     = AIBaseData.CreateAIBaseData(mValueType);

        if (mSetType != AIBaseData.SetType.enReset)
        {
            mValue.SetValue(xmlElement.GetAttribute("Value"));
        }
    }