Beispiel #1
0
    // ------------------------------------------------------------------
    /// \param _clipping the clipping plane
    /// \param _plane the plane to add to clip
    /// add plane to clipping list
    // ------------------------------------------------------------------
    public static void AddPlaneInEditor( this exClipping _clipping, exPlane _plane )
    {
        _clipping.AddPlane (_plane);

        exClipping clipPlane = _plane as exClipping;
        // if this is not a clip plane
        if ( clipPlane == null ) {
            ApplyClipMaterialInEditor ( _clipping, _plane );
        }
    }
Beispiel #2
0
 public static bool AddAttackPlane(this Critter npc, uint priority, Critter target, int minHp)
 {
     NpcPlane plane=Global.CreatePlane();
     plane.Type=PlaneType.Attack;
     plane.Priority=(priority==0?Priorities.Attack:priority);
     plane.Attack_TargId=target.Id;
     plane.Attack_MinHp=minHp;
     plane.Attack_IsGag=false;
     plane.Attack_GagHexX=0;
     plane.Attack_GagHexY=0;
     plane.Attack_LastHexY=target.HexY;
     plane.Attack_LastHexX=target.HexX;
     plane.Run=false;
     return npc.AddPlane(plane);
 }
Beispiel #3
0
        public static bool AddAttackPlane(this Critter npc, uint priority, uint critId)
        {
            Critter target=Global.GetCritter(critId);
            if(target == null)
            {
                Global.Log("Target not found.");
                return false;
            }

            NpcPlane plane=Global.CreatePlane();
            plane.Type=PlaneType.Attack;
            plane.Priority=(priority==0?Priorities.Attack:priority);
            plane.Attack_TargId=target.Id;
            plane.Attack_MinHp=Global.DeadHitPoints;
            plane.Attack_IsGag=false;
            plane.Attack_GagHexX=0;
            plane.Attack_GagHexY=0;
            plane.Attack_LastHexX=target.HexX;
            plane.Attack_LastHexY=target.HexY;
            plane.Run=false;
            return npc.AddPlane(plane);
        }
Beispiel #4
0
 public static bool AddAttackPlane(this Critter npc, uint priority, Critter target)
 {
     if(npc.IsPlayer)
     {
         Map map=npc.GetMap();
         uint loc=0;
         if(map != null) loc=map.GetLocation().GetProtoId();
         Global.Log("ERR: adding attack plane to player, loc pid={0}", loc);
     }
     NpcPlane plane=Global.CreatePlane();
     plane.Type=PlaneType.Attack;
     plane.Priority=(priority==0?Priorities.Attack:priority);
     plane.Attack_TargId=target.Id;
     plane.Attack_MinHp=Global.DeadHitPoints;
     plane.Attack_IsGag=false;
     plane.Attack_GagHexX=0;
     plane.Attack_GagHexY=0;
     plane.Attack_LastHexX=target.HexX;
     plane.Attack_LastHexY=target.HexY;
     plane.Run=false;
     return npc.AddPlane(plane);
 }
Beispiel #5
0
        public static bool AddWalkPlane(this Critter npc, uint priority, int identifier, uint identifierExt, ushort hexX, ushort hexY, Direction dir, bool run, uint cut)
        {
            if(!npc.IsCanWalk) return false;

            NpcPlane plane=Global.CreatePlane();
            plane.Type=PlaneType.Walk;
            plane.Priority=(priority==0?Priorities.Walk:priority);
            plane.Identifier=identifier;
            plane.IdentifierExt=identifierExt;
            plane.Walk_HexX=hexX;
            plane.Walk_HexY=hexY;
            plane.Walk_Dir=dir;
            plane.Run=run;
            plane.Walk_Cut=cut;
            return npc.AddPlane(plane);
        }
Beispiel #6
0
 public static bool AddPickPlane(this Critter npc, uint priority, Item item, uint useItemId, bool toOpen, bool run)
 {
     NpcPlane plane=Global.CreatePlane();
     plane.Type=PlaneType.Pick;
     plane.Priority=(priority==0?Priorities.Pick:priority);
     plane.Pick_HexX=item.HexX;
     plane.Pick_HexY=item.HexY;
     plane.Pick_Pid=item.GetProtoId();
     plane.Pick_UseItemId=useItemId;
     plane.Pick_ToOpen=toOpen;
     plane.Run=run;
     return npc.AddPlane(plane);
 }
Beispiel #7
0
 public static bool AddPickPlane(this Critter npc, uint priority, ushort hexX, ushort hexY, ushort protoId, uint useItemId, bool toOpen)
 {
     NpcPlane plane=Global.CreatePlane();
     plane.Type=PlaneType.Pick;
     plane.Priority=(priority==0?Priorities.Pick:priority);
     plane.Pick_HexX=hexX;
     plane.Pick_HexY=hexY;
     plane.Pick_Pid=protoId;
     plane.Pick_UseItemId=useItemId;
     plane.Pick_ToOpen=toOpen;
     plane.Run=false;
     return npc.AddPlane(plane);
 }
Beispiel #8
0
 public static bool AddMiscPlane(this Critter npc, uint priority, uint waitSecond, string funcName)
 {
     NpcPlane plane=Global.CreatePlane();
     plane.Type = PlaneType.Misc;
     plane.Priority = priority==0 ? Priorities.Misc : priority;
     plane.Misc_WaitSecond = waitSecond;
     if(funcName != null && !plane.Misc_SetScript(funcName))
     {
         Global.Log("Set script <{0}> fail", funcName);
         return false;
     }
     return npc.AddPlane(plane);
 }