MoTaForPSVita/Assets/Scripts/Event/Level/EventLevel31Actor2.cs

61 lines
2.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EventLevel31Actor2 : ActorController
{
public override bool Interaction()
{
switch (GameManager.Instance.PlotManager.PlotDictionary[8])
{
// 状态 1 交易
case 1:
GameManager.Instance.UIManager.ShowInteractionDialog(GetComponent<ResourceController>().Name, "我有四把黄钥匙和一把蓝钥匙,只需 1000 金币你就能得到它。", "我买了", "不需要", () =>
{
// 花费 1000 金币
if (GameManager.Instance.PlayerManager.PlayerInfo.Gold < 1000)
{
GameManager.Instance.UIManager.ShowInfo("金币不够哦~再去历练一下叭~");
// 音频播放
GameManager.Instance.SoundManager.PlaySound(ESoundType.Effect, "No");
return;
}
GameManager.Instance.PlayerManager.PlayerInfo.Gold -= 1000;
// 获得 黄钥匙 4 把
for (int i = 0; i < 4; i++)
{
GameManager.Instance.BackpackManager.PickUp(GameManager.Instance.PoolManager.GetResourceInFreePool(EResourceType.Item, 1).GetComponent<ItemController>());
}
// 获得 蓝钥匙 1 把
GameManager.Instance.BackpackManager.PickUp(GameManager.Instance.PoolManager.GetResourceInFreePool(EResourceType.Item, 2).GetComponent<ItemController>());
// 变更剧情状态
GameManager.Instance.PlotManager.PlotDictionary[8] = 2;
// 打开人物控制器
GameManager.Instance.PlayerManager.Enable = true;
// 音频播放
GameManager.Instance.SoundManager.PlaySound(ESoundType.Effect, "Yes");
});
break;
case 2:
string talk = "魔塔有50层但你不能直接到达。";
// 商人说话
GameManager.Instance.UIManager.ShowDialog(GetComponent<ResourceController>().Name, new List<string> { talk }, () =>
{
// 记笔记
GameManager.Instance.PlayerManager.AddInfoToNotepad(talk);
// 打开人物控制器
GameManager.Instance.PlayerManager.Enable = true;
// 音频播放
GameManager.Instance.SoundManager.PlaySound(ESoundType.Music, "31-39");
// NPC 回收
GameManager.Instance.PoolManager.RecycleResource(gameObject);
});
break;
default:
break;
}
return false;
}
}