mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-14 02:34:10 +00:00
AI World Lines Cooldown
This commit is contained in:
1 parent
d9d2481b7f
commit
90b34127c3
1 file changed
+19
-14
@@ -6,20 +6,25 @@ import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class EntityAIWorldLines extends EntityAIBase {
|
||||
|
||||
private EntityNPCInterface npc;
|
||||
public EntityAIWorldLines(EntityNPCInterface npc){
|
||||
this.npc = npc;
|
||||
private EntityNPCInterface npc;
|
||||
private int cooldown = 100;
|
||||
|
||||
public EntityAIWorldLines(EntityNPCInterface npc){
|
||||
this.npc = npc;
|
||||
this.setMutexBits(AiMutex.PASSIVE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldExecute() {
|
||||
return !npc.isAttacking() && !npc.isKilled() && npc.advanced.hasWorldLines() && npc.getRNG().nextInt(1900) == 1;
|
||||
}
|
||||
|
||||
public void startExecuting()
|
||||
{
|
||||
npc.saySurrounding(npc.advanced.getWorldLine());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldExecute() {
|
||||
if(cooldown > 0){
|
||||
cooldown--;
|
||||
}
|
||||
return !npc.isAttacking() && !npc.isKilled() && npc.advanced.hasWorldLines() && npc.getRNG().nextInt(1800) == 1;
|
||||
}
|
||||
|
||||
public void startExecuting(){
|
||||
cooldown = 100;
|
||||
npc.saySurrounding(npc.advanced.getWorldLine());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user