1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/python
# -*- coding: GBK -*-
#-------------------------------------------------------------------------------
#
##@package NPCAI.AIType_55
#
# @todo:Ëþ·ÀÀàÌØÊâ¹ÖÎïAI
# @author hxp
# @date 2017-11-29
# @version 1.0
#
# ÏêϸÃèÊö: Ëþ·ÀÀàÌØÊâ¹ÖÎïAI, Ö»´òÖ¸¶¨Ä¿±êNPCID
#
#-------------------------------------------------------------------------------
#"""Version = 2017-11-29 18:00"""
#-------------------------------------------------------------------------------
 
import ChConfig
import FBDefenseCommon
import IPY_GameWorld
import GameWorld
#-------------------------------------------------------------------------------
 
## ³õʼ»¯
#  @param curNPC µ±Ç°npc
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def DoInit(curNPC):
    curNPC.GetNPCAngry().Init(ChConfig.Def_NormalNPCAngryCount)
    return
 
def OnNPCReborn(curNPC):
    curNPC.SetIsNeedProcess(True)
    return
 
## »ñÈ¡NPCÊÇ·ñÏÞÖÆ¹¥»÷Ä¿±ê£¬AIÌØÊâ¶îÍâÅжÏ
def GetNPCAttackTagLimit(curNPC, tagObj):
    tagNPCIDList = [31704003] # Ö®ºó¿É¸ù¾Ý²»Í¬µÄÐèÇó¿ªÅäÖò»Í¬µÄ¹¥»÷Ä¿±ê£¬Ä¿Ç°Ö»ÓÐÊØÎÀÈ˻ʣ¬ÔÝʱдËÀ
    tagObjType = tagObj.GetGameObjType()
    if tagObjType == IPY_GameWorld.gotNPC:
        if tagObj.GetNPCID() in tagNPCIDList:
            #GameWorld.DebugLog("Ö»¹¥»÷Ö¸¶¨Ä¿±êNPCID£¬ÆäËûĬÈÏÏÞÖÆ!")
            return False
    #GameWorld.DebugLog("¹¥»÷Ä¿±êÊÜÏÞ!tagID=%s" % tagObj.GetID())
    return True
 
## Ö´ÐÐAI
#  @param curNPC µ±Ç°npc
#  @param tick µ±Ç°Ê±¼ä
#  @return None
#  @remarks º¯ÊýÏêϸ˵Ã÷.
def ProcessAI(curNPC, tick):
    
    if not FBDefenseCommon.NormalCheck(curNPC, tick):
        return
    
    FBDefenseCommon.NormalFight(curNPC, tick, isUpdAngry=False)
    return