public void set_MP(KBEngine.Entity entity, object v) { object vv = entity.getDefinedPropterty("MP_Max"); if (entity.renderObj != null) { object oldvv = entity.getDefinedPropterty("old_MP"); if (oldvv != null) { Int32 diff = (Int32)vv - (Int32)oldvv; if (diff > 0) { ((SceneEntityObject)entity.renderObj).addMP(diff); } entity.setDefinedPropterty("old_MP", vv); } else { entity.addDefinedPropterty("old_MP", vv); } } if (entity.isPlayer()) { game_ui_autopos.updatePlayerBar_MP(v, vv); } else { game_ui_autopos.updateTargetBar_MP(v, vv); } }