Example #1
0
    public override void initStroy(Character chara, RoundController roundController, TaskMananger taskMananger)
    {
        string     monsteUrl     = "Prefabs/Monsters/BenMonster";
        GameObject servantObject = Instantiate(Resources.Load(monsteUrl)) as GameObject;
        BenMonster benMonster    = servantObject.GetComponent <BenMonster>();

        benMonster.setCurrentRoom(chara.getCurrentRoom());
        benMonster.init();
        roundController.setEndRound(benMonster);

        Character[] charas = roundController.getAllChara();

        Debug.Log("UI 显示《《剧情模式已经开启: " + this.getStoryInfo());
        chara.setScriptAction(this.getBadManScript());
        chara.setBoss(true);
        for (int i = 0; i < charas.Length; i++)
        {
            if (charas[i].getName() != chara.getName())
            {
                charas[i].setScriptAction(this.getGoodManScript());
                charas[i].setBoss(false);
            }
        }

        // init story task..
        initTask(taskMananger, chara, benMonster);
    }
    public bool getConditionStatus(Character chara, RoomInterface room, RoundController roundController)
    {
        Kate       kete    = (Kate)roundController.getCharaByName(SystemConstant.P4_NAME);
        BenMonster monster = (BenMonster)roundController.getCharaByName(SystemConstant.MONSTER1_NAME);

        if (monster.isDead() && (kete.isDead() || kete.getAbilityInfo()[3] >= 7))
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
Example #3
0
    private void initTask(TaskMananger taskMananger, Character chara, BenMonster benMonster)
    {
        TaskAward award = new TaskAward();

        award.setAttriAwards(0, 0, 0, 0);
        string taskDesc = "萝莉侦探似乎看见了什么,突然变得狂暴起来,见人就攻击,能否活着逃离这个空间成了最大的问题。";
        string taskName = "逃出侦探的追杀";
        List <TaskItemInterface> taskItems = new List <TaskItemInterface>();
        KillSomethingTaskItem    cti       = new KillSomethingTaskItem("杀死复活的怪物。");

        cti.setTarget(benMonster);
        KillOrSaveTaskItem cti2 = new KillOrSaveTaskItem("杀死萝莉侦探或者唤醒侦探");

        cti2.setTarget(chara);
        taskItems.Add(cti);
        taskItems.Add(cti2);
        BlackSignTask task = new BlackSignTask(TaskConstant.TASK_STORY_CODE_01, TaskConstant.TASK_TYPE_02, award, null, taskDesc, TaskConstant.TASK_NPC_CODE_STORY, null, taskItems,
                                               taskName, TaskConstant.STATUS_INIT);

        taskMananger.regisisterStoryTask(task);
    }
Example #4
0
 // Use this for initialization
 void Start()
 {
     isStartStory    = false;
     roundController = FindObjectOfType <RoundController>();
     roomContraller  = FindObjectOfType <RoomContraller>();
     duiHuaUImanager = FindObjectOfType <DuiHuaUImanager>();
     taskMananger    = FindObjectOfType <TaskMananger>();
     if (!this.neworLoad)
     {
         Debug.Log("loading  begin..");
         string   datapath = Application.persistentDataPath + "/Save/SaveData0.sav";
         SaveData data     = (SaveData)IOHelper.GetData(datapath, typeof(SaveData));
         if (data.StoryInfo.IsStoryStart)
         {
             Debug.Log("loading story begin..");
             isStartStory = true;
             if (data.StoryInfo.StoryCode == StoryConstan.STORY_CODE_02)
             {
                 this.story = new BlackSignStory();
                 BlackSignBadScript bsbs     = (BlackSignBadScript)this.story.getBadManScript();
                 List <string>      tempList = new List <string>();
                 foreach (string name in bsbs.loadCheck())
                 {
                     if (roundController.getCharaByName(name) != null && !roundController.getCharaByName(name).isDead())
                     {
                         Debug.Log("loading check targetName begin.." + name + roundController.getCharaByName(name).isDead());
                         tempList.Add(name);
                     }
                 }
                 bsbs.loadCheck().Clear();
                 foreach (string name in tempList)
                 {
                     bsbs.loadCheck().Enqueue(name);
                 }
                 string     monsteUrl     = "Prefabs/Monsters/BenMonster";
                 GameObject servantObject = Instantiate(Resources.Load(monsteUrl)) as GameObject;
                 BenMonster benMonster    = servantObject.GetComponent <BenMonster>();
                 benMonster.init();
                 benMonster.init(data.BenMonster);
                 benMonster.setInitRoom(data.BenMonster.Xyz);
                 roundController.setEndRound(benMonster);
             }
             Character[] charas = roundController.getAllChara();
             foreach (Character chara in charas)
             {
                 if (chara.getName() == SystemConstant.P4_NAME)
                 {
                     Debug.Log("chara.isBoss() :" + chara.isBoss());
                 }
                 if (chara.isBoss())
                 {
                     chara.setScriptAction(this.story.getBadManScript());
                 }
                 else
                 {
                     chara.setScriptAction(this.story.getGoodManScript());
                 }
             }
         }
         else
         {
             Debug.Log("no need loading stroy..");
         }
     }
     else
     {
         Debug.Log("no need loading ..");
     }
 }