Example #1
0
    public static void OnRpcOnSpellUsedCallbackRegion(string msg, string value)
    {
        Debug.Log(value);
        switch (msg)
        {
        case "RandomEvent":
            eventsList [int.Parse(value)].ApplyChanges();
            eventsList.Remove(eventsList [int.Parse(value)]);
            break;

        case "NewRegionInfected":
            Country region = GetCountryFromName(value);
            region.infected   += 1;
            region.Population -= 1;
            break;

        case "CloseBorder":
            Main_Controller_def.CloseBorder(GetCountryFromName(value));
            break;

        case "Localisation":
            Instance.OpenNotification("Recherche positive: L'adversaire a trouvé le virus ! ", value + " est une région contenant au moins une personne infectée.");
            Main_Controller_def.Localisation(GetCountryFromName(value));
            break;

        case "ResearchSymp":
            //FIXME
            Main_Controller_def.ResearchSymp(value);
            break;

        case "ResearchTrans":
            //FIXME
            Main_Controller_def.ResearchTrans(value);
            break;

        case "SanitaryCampaign":
            Main_Controller_def.SanitaryCampaign(GetCountryFromName(value));
            break;

        case "RegionSelected":
            isStarted   = true;
            StartRegion = GetCountryFromName(value);
            break;

        default:
            Debug.Log("WTF?");
            break;
        }
    }
Example #2
0
    public static void OnRpcOnSpellUsedCallbackRegion(string msg, string value)
    {
        Debug.Log(value);
        switch (msg)
        {
        case "RandomEvent":
            eventsList [int.Parse(value)].ApplyChanges();
            eventsList.Remove(eventsList [int.Parse(value)]);
            break;

        case "NewRegionInfected":
            Country region = GetCountryFromName(value);
            region.infected   += 1;
            region.Population -= 1;
            break;

        case "CloseBorder":
            Main_Controller_def.CloseBorder(GetCountryFromName(value));
            break;

        case "Localisation":
            Main_Controller_def.Localisation(GetCountryFromName(value));
            break;

        case "ResearchSymp":
            //FIXME
            Main_Controller_def.ResearchSymp(value);
            break;

        case "ResearchTrans":
            //FIXME
            Main_Controller_def.ResearchTrans(value);
            break;

        case "SanitaryCampaign":
            Main_Controller_def.SanitaryCampaign(GetCountryFromName(value));
            break;

        case "RegionSelected":
            isStarted   = true;
            StartRegion = GetCountryFromName(value);
            break;

        default:
            Debug.Log("WTF?");
            break;
        }
    }
Example #3
0
    private void FixedUpdate()
    {
        if (!canStart)
        {
            canStart = Main_Controller.symptoms.Count != 0 || Main_Controller.transmitions.Count != 0;
            return;
        }
        if (i != 450)
        {
            i++;
            return;
        }
        i = 0;

        if (!located)
        {
            located = Main_Controller_def.Localisation(
                Main_Controller.Earth.regionlist[Random.Range(0, Main_Controller.symptoms.Count)]);
        }
        else
        {
            Main_Controller_def.ResearchAntidote();
            if (Main_Controller.transmitions.Count != 0)
            {
                if (Main_Controller.symptoms.Count != 0 && !Main_Controller_def.ResearchTrans(Main_Controller.transmitions[Random.Range(0, Main_Controller.transmitions.Count)]))
                {
                    Main_Controller_def.ResearchSymp(Main_Controller.symptoms[Random.Range(0, Main_Controller.symptoms.Count)]);
                }
            }
        }


        if (Main_Controller_def.foundSymptoms.Count == Main_Controller.symptoms.Count)
        {
            if (Main_Controller_def.foundTransmitions.Count == Main_Controller.transmitions.Count)
            {
                text.text = "L'IA recherche l'antidote";
            }
            else
            {
                text.text = "L'IA a recherché tous les symptomes";
            }
        }
        else
        {
            Debug.Log("trans found : " + Main_Controller_def.foundTransmitions.Count + "trans: " + Main_Controller.transmitions.Count);
            Debug.Log("symp found : " + Main_Controller_def.foundSymptoms.Count + "symp: " + Main_Controller.symptoms.Count);
            if (Main_Controller_def.foundTransmitions.Count == Main_Controller.transmitions.Count)
            {
                text.text = "L'IA a recherché toutes les transmitions";
            }
            else
            {
                if (located)
                {
                    text.text = "L'IA a localisé le virus";
                }
                else
                {
                    text.text = "L'IA tente de localiser le virus";
                }
            }
        }
    }