GameFramework.EntityController.SendImpact C# (CSharp) Method

SendImpact() private method

private SendImpact ( TableConfig cfg, int seq, int curObjId, int srcObjId, int targetId, int impactId, object>.Dictionary args ) : ImpactInfo
cfg TableConfig
seq int
curObjId int
srcObjId int
targetId int
impactId int
args object>.Dictionary
return ImpactInfo
        internal ImpactInfo SendImpact(TableConfig.Skill cfg, int seq, int curObjId, int srcObjId, int targetId, int impactId, Dictionary<string, object> args)
        {
            EntityInfo targetObj = m_Scene.EntityManager.GetEntityInfo(targetId);
            if (null != targetObj) {
                if (null != cfg) {
                    Quaternion hitEffectRotation = Quaternion.Identity;
                    EntityInfo srcObj = m_Scene.EntityManager.GetEntityInfo(srcObjId);
                    var addArgs = new Dictionary<string, object> { { "hitEffectRotation", hitEffectRotation } };
                    ImpactInfo impactInfo = null;
                    if (impactId <= 0 || impactId >= SkillInstance.c_FirstInnerHitSkillId) {
                        impactInfo = new ImpactInfo(m_Scene.SkillSystem.PredefinedSkill.HitSkillCfg);
                        impactId = PredefinedSkill.c_HitSkillId;
                    } else {
                        impactInfo = new ImpactInfo(impactId);
                    }
                    if (null != impactInfo.ConfigData) {
                        if (TryInitImpactInfo(impactInfo, cfg, seq, curObjId, srcObjId, args)) {
                            if (impactInfo.ConfigData.type == (int)SkillOrImpactType.Buff) {
                                ImpactInfo oldImpactInfo = targetObj.GetSkillStateInfo().FindImpactInfoById(impactInfo.ImpactId);
                                if (null != oldImpactInfo) {
                                    oldImpactInfo.DurationTime += impactInfo.DurationTime;
                                    return oldImpactInfo;
                                }
                            }
                        targetObj.GetSkillStateInfo().AddImpact(impactInfo);
                        SkillInfo skillInfo = targetObj.GetSkillStateInfo().GetCurSkillInfo();
                        if (null != skillInfo && (cfg.isInterrupt || impactInfo.ConfigData.isInterrupt)) {
                            m_Scene.SkillSystem.StopSkill(targetId, skillInfo.SkillId, 0, true);
                        }
                        m_Scene.SkillSystem.StartSkill(targetId, impactInfo.ConfigData, impactInfo.Seq, args, addArgs);
                        return impactInfo;
                        }
                    } else {
                        LogSystem.Error("impact {0} config can't found !", impactInfo.ImpactId);
                    }
                }
            }
            return null;
        }

Same methods

EntityController::SendImpact ( TableConfig cfg, int seq, int curObjId, int srcObjId, int targetId, int impactId, bool isFinal, object>.Dictionary args ) : ImpactInfo
EntityController::SendImpact ( int srcObjId, int targetId, int impactId, int skillId ) : ImpactInfo

Usage Example

コード例 #1
0
 static public int SendImpact(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 5)
         {
             GameFramework.EntityController self = (GameFramework.EntityController)checkSelf(l);
             System.Int32 a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             System.Int32 a3;
             checkType(l, 4, out a3);
             System.Int32 a4;
             checkType(l, 5, out a4);
             var ret = self.SendImpact(a1, a2, a3, a4);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         else if (argc == 9)
         {
             GameFramework.EntityController self = (GameFramework.EntityController)checkSelf(l);
             TableConfig.Skill a1;
             checkType(l, 2, out a1);
             System.Int32 a2;
             checkType(l, 3, out a2);
             System.Int32 a3;
             checkType(l, 4, out a3);
             System.Int32 a4;
             checkType(l, 5, out a4);
             System.Int32 a5;
             checkType(l, 6, out a5);
             System.Int32 a6;
             checkType(l, 7, out a6);
             System.Boolean a7;
             checkType(l, 8, out a7);
             System.Collections.Generic.Dictionary <System.String, System.Object> a8;
             checkType(l, 9, out a8);
             var ret = self.SendImpact(a1, a2, a3, a4, a5, a6, a7, a8);
             pushValue(l, true);
             pushValue(l, ret);
             return(2);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }