Esempio n. 1
0
 public void changeStackAmount(int amount) {
   stacks = amount;
   int entityId = targetInterface.getSpatial().getUserData(UserData.ENTITY_ID);
   CmdBuffStacks cmdStacks = new CmdBuffStacks(entityId, buffId, stacks);
   Spatial spatial = targetInterface.getSpatial();
   ServerFog fog = spatial.getControl(CEntityVariable.class).getAwareness().getFog();
   fog.addCommand(spatial, cmdStacks);
 }
Esempio n. 2
0
  public void attachToCharacter(CInfluenceInterface targetInterface) {
    this.targetInterface = targetInterface;
    targetInterface.addBuff(this);

    CmdBuff buffCommand = generateBuffCommand(true);
    if (buffCommand != null) {
      Spatial spatial = targetInterface.getSpatial();
      spatial
          .getControl(CEntityVariable.class)
          .getAwareness()
          .getFog()
          .addCommand(spatial, buffCommand);
    }
  }
Esempio n. 3
0
  public void destroy() {
    CmdBuff buffCommand = generateBuffCommand(false);
    if (buffCommand != null) {
      Spatial spatial = targetInterface.getSpatial();
      ServerFog fog = spatial.getControl(CEntityVariable.class).getAwareness().getFog();
      fog.addCommand(spatial, buffCommand);
    }

    for (EndEventListener endHandler : buffEndHandlers) {
      endHandler.buffEnded();
    }
  }
Esempio n. 4
0
 public CmdBuff generateBuffCommand(boolean added) {
   int entityId = targetInterface.getSpatial().getUserData(UserData.ENTITY_ID);
   return typeId == -1 ? null : new CmdBuff(entityId, typeId, buffId, duration, stacks, added);
 }