예제 #1
0
 public void WriteData(int wordOffset, ushort word)
 {
     if (wordOffset >= SectorGeometry.Trident.DataSize)
     {
         //
         // We just ignore this; the microcode may send extra words
         // and the controller was expected to ignore them.
         //
         Log.Write(LogType.Warning, LogComponent.TridentDisk, "Extra data word ({0}) written, offset {1}", Conversion.ToOctal(word), wordOffset);
     }
     else
     {
         CurrentSector.WriteData(wordOffset, word);
     }
 }
예제 #2
0
 public ushort ReadData(int wordOffset)
 {
     if (wordOffset >= SectorGeometry.Trident.DataSize)
     {
         //
         // We just ignore this; the microcode may read extra words
         // and the controller was expected to ignore them.
         //
         Log.Write(LogType.Warning, LogComponent.TridentDisk, "Extra data word read, offset {0 }", wordOffset);
         return(0);
     }
     else
     {
         return(CurrentSector.ReadData(wordOffset));
     }
 }
예제 #3
0
    public void OnEditCamera(object o, EventArgs args)
    {
        Camera camera = null;

        foreach (IGameObject Object in CurrentSector.GetObjects())
        {
            if (Object is Camera)
            {
                camera = (Camera)Object;
            }
        }
        if (camera == null)
        {
            camera = new Camera();
            CurrentSector.Add(camera, true);
        }
        EditProperties(camera, "Camera");
    }
예제 #4
0
    private void Start()
    {
        gm_GameManager = GameObject.Find("EventSystem").GetComponent <GameManager>();
        //scr_ClickSoundScript = GameObject.Find("Audio Source").GetComponent<UI_ClickSoundScript>();

        evtInt_PopupScreen = transform.parent.GetComponent <EventInteract>();
        evtInt_PopupScreen.go_Name.GetComponent <Text>().text        = s_name;
        evtInt_PopupScreen.go_description.GetComponent <Text>().text = s_Information;
        evtInt_PopupScreen.go_Image.GetComponent <Image>().sprite    = Event_Popup_Sprite;

        switch (i_EventType)
        {
        case 0: {     //Start Event, infect people in random sector. Isolated.
            evtInt_PopupScreen.go_Button.GetComponentInChildren <Text>().text = s_ButtonText;
            int i_rand;
            i_rand = Random.Range(0, gm_GameManager.Sector.Length - 2);
            if (i_rand > 1)
            {
                i_rand += 2;
            }
            gm_GameManager.Sector[i_rand].GetComponent <corona_region_manager>().Infect(i_StartEventImpact);
            Debug.Log("Start event,  infected " + i_StartEventImpact + " people in sector " + i_rand + ".");
            break;
        }

        case 1:     //Single Random Sector Event Flat Values
            evtInt_PopupScreen.go_Button.GetComponentInChildren <Text>().text = s_ButtonText;
            corona_region_manager crm_RandomRegionManager = gm_GameManager.Sector[Random.Range(0, gm_GameManager.Sector.Length)].GetComponent <corona_region_manager>();
            crm_RandomRegionManager.Die(i_KillAmount);
            crm_RandomRegionManager.f_Panic        += PanicImpact;
            crm_RandomRegionManager.f_OutputFactor += EconomyImpact;
            crm_RandomRegionManager.f_FactorSpread += VirusImpact;
            gm_GameManager.SetCurrentEconomy(gm_GameManager.GetCurrentEconomy() + i_EconomyFlatImpact);
            break;

        case 2:     //Finisher Event, Game Over (good or bad, win or lose)
            //nothing, just instantiating the prefab is enough.
            break;

        case 3: {     //Global Event. Isolated.
            foreach (GameObject CurrentSector in gm_GameManager.Sector)
            {
                corona_region_manager crm_RegionManager = CurrentSector.GetComponent <corona_region_manager>();
                crm_RegionManager.Die(i_KillAmount);
                crm_RegionManager.f_Panic        += PanicImpact;
                crm_RegionManager.f_OutputFactor += EconomyImpact;
                crm_RegionManager.f_FactorSpread += VirusImpact;
            }
            gm_GameManager.SetCurrentEconomy(gm_GameManager.GetCurrentEconomy() + i_EconomyFlatImpact);
            break;
        }

        default:
            Debug.Log("Unknown event type called in Event.cs");
            break;
        }
        if (i_EconomyFlatImpact != 0)
        {
            if (gm_GameManager.currentEconomy >= i_EconomyFlatImpact)
            {
                gm_GameManager.currentEconomy -= i_EconomyFlatImpact;
            }
            else
            {
                //gm_GameManager.CallEvent(); //TODO economic defeat event
                Debug.Log("CALL ECONOMIC DEFEAT IF IMPLEMENTED!!!");
            }
        }
        if (f_ResearchProgress >= 0)
        {
            gm_GameManager.SetCurrentCure(gm_GameManager.GetCurrentCure() + f_ResearchProgress);
        }
    }