public void useItem(Item item, NPC chara, Character forNPCchara, BattleMenuUI battleMenuUI) { Debug.Log("战斗中使用物品"); if (item == null) { msg.showMessage("请选择一个物品。"); } else { if (item.getType() == ItemConstant.ITEM_TYPE_POTION || item.getType() == ItemConstant.ITEM_TYPE_TOOL) { Debug.Log("对自己使用"); this.useItem(item, chara); } else { Debug.Log("对NPC使用任务道具"); if (useItemSpec(forNPCchara, item, battleMenuUI)) { chara.getBag().removeItem(item); } ; } } }
public void showBagItemUI(Character chara, Character enemy, BattleMenuUI battleMenuUI) { this.usedChara = enemy; this.battleMenuUI = battleMenuUI; this.player = chara; showBagItemUI(); }
// Use this for initialization void Start() { duiHuaUImanager = FindObjectOfType <DuiHuaUImanager>(); roundController = FindObjectOfType <RoundController>(); battleController = FindObjectOfType <BattleController>(); bagUIManager = FindObjectOfType <BagUIManager>(); battleMenuUI = FindObjectOfType <BattleMenuUI>(); mouseMoveManger = FindObjectOfType <MouseMoveManger>(); confirmManageUI = FindObjectOfType <ConfirmManageUI>(); }
void Awake() { if (bmui == null) { DontDestroyOnLoad(gameObject); bmui = this; } else if (bmui != this) { Destroy(gameObject); } }
public void closeBagItemUI() { if (battleMenuUI != null) { Debug.Log("player 1" + player); Debug.Log("enemy 1" + this.usedChara); if (battleMenuUI.getShowAgain()) { battleMenuUI.showBattleUI(player, this.usedChara, battleMenuUI.isFighter); } } BagItemMenuUI.SetActive(false); BagItemMenuUI.transform.localPosition = hidePos; selectItem = null; battleMenuUI = null; mouseMoveManger.updateLock(false); }
private bool spItemforP4(NPC forNPCchara, Item item, BattleMenuUI battleMenuUI) { Debug.Log("使用任务道具"); if (forNPCchara.isBoss() && item.getCode() == ItemConstant.ITEM_CODE_SPEC_Y0006) { int san = forNPCchara.getAbilityInfo()[3]; if (san + 4 > forNPCchara.getMaxAbilityInfo()[3]) { forNPCchara.getAbilityInfo()[3] = forNPCchara.getMaxAbilityInfo()[3]; } else { forNPCchara.getAbilityInfo()[3] = san + 2; } Debug.Log("使用任务道具成功"); battleMenuUI.hidenUI(false); duiHuaUImanager.showDuiHua(forNPCchara.getLiHuiURL(), new string[] { "父亲。。父亲的照片。", "为什么他会在这里?" }, 1); return(true); } else if (forNPCchara.isBoss() && item.getCode() == ItemConstant.ITEM_CODE_SPEC_Y0007) { int san = forNPCchara.getAbilityInfo()[3]; if (san + 3 > forNPCchara.getMaxAbilityInfo()[3]) { forNPCchara.getAbilityInfo()[3] = forNPCchara.getMaxAbilityInfo()[3]; } else { forNPCchara.getAbilityInfo()[3] = san + 3; } Debug.Log("使用任务道具成功"); battleMenuUI.hidenUI(false); duiHuaUImanager.showDuiHua(forNPCchara.getLiHuiURL(), new string[] { "医院保密文件?", "难道医生是好人?" }, 1); return(true); } else { Debug.Log("使用任务道具失败"); return(false); } }
private bool useItemSpec(Character forNPCchara, Item item, BattleMenuUI battleMenuUI) { if (forNPCchara != null) { if (forNPCchara.getName() == SystemConstant.P4_NAME) { return(spItemforP4((NPC)forNPCchara, item, battleMenuUI)); } else if (forNPCchara.getName() == SystemConstant.MONSTER1_NAME) { return(spItemforM1(forNPCchara, item)); } else { msg.showMessage(forNPCchara.getName() + "似乎对这个没什么兴趣。"); return(false); } } else { msg.showMessage("什么事情都没有发生。"); return(false); } }
// Use this for initialization void Start() { uiManager = FindObjectOfType <RollDiceUIManager>(); battleMenuUI = FindObjectOfType <BattleMenuUI>(); }