public RohstoffpreiseForm(int sid, int lev) { InitializeComponent(); lbl_ueberschrift.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); level = lev; GlobalAktiveStadt = sid; lbl_ueberschrift.Text = "Rohstoffpreise in " + SW.Dynamisch.GetStadtwithID(GlobalAktiveStadt).GetGebietsName(); lbl_ueberschrift.Left = (this.Width - lbl_ueberschrift.Width) / 2; for (int i = 1; i < SW.Statisch.GetMaxRohID(); i++) { // Bild laden if (Grafik.GetRohstoffIcons80px().Count >= i) { this.Controls["btn_" + i.ToString()].BackgroundImage = Grafik.GetRohstoffIcons80px()[i]; ttRohstoffe.SetToolTip(this.Controls["btn_" + i.ToString()], SW.Dynamisch.GetRohstoffwithID(i).GetRohName()); } // Preis laden this.Controls["lbl_" + i.ToString()].Text = SW.Dynamisch.GetStadtwithID(GlobalAktiveStadt).GetRohstoffPreisVonIDX(i).ToString(); this.Controls["lbl_" + i.ToString()].Left = this.Controls["btn_" + i.ToString()].Left + (this.Controls["btn_" + i.ToString()].Width - this.Controls["lbl_" + i.ToString()].Width) / 2; } }
public NetzwerkspielStarten() { InitializeComponent(); label1.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); txb_namenEingeben.Focus(); }
public Geldleiher(int globk, ref Label lblgold) { InitializeComponent(); lbl_text.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_1.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_2.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); btn_d1.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_d2.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); _lbl_taler = lblgold; _randomKIID = SW.Statisch.Rnd.Next(SW.Statisch.GetMinKIID(), SW.Statisch.GetMaxKIID()); _summe = Convert.ToInt32(0.1 * SW.Dynamisch.GetKIwithID(_randomKIID).GetTaler()); _zins = SW.Statisch.Rnd.Next(SW.Statisch.GetKreditZinsMin(), SW.Statisch.GetKreditZinsMax() + 1); if (SW.Dynamisch.GetAktHum().CheckPrivilegX(30) == true) { _zins = Convert.ToInt16(_zins / 2); } _jahre = SW.Statisch.Rnd.Next(4, 8); lbl_text.Text = SW.Dynamisch.GetKIwithID(_randomKIID).GetName() + " bietet Euch " + _summe.ToStringGeld() + " zu " + _zins.ToString() + "% Zinsen jährlich, rückzahlbar bis zum Jahre " + (SW.Dynamisch.GetAktuellesJahr() + _jahre).ToString() + ". Wollt Ihr"; }
public KontrahentenForm(int modus) { InitializeComponent(); lbl_mittelland.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); _modus = modus; btn_1.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_2.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_3.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_4.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_5.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_6.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_7.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_8.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_9.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_10.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_w.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbPfeilR1); btn_w5.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbPfeilR2); btn_z.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbPfeilL1); btn_z5.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbPfeilL2); btn_w.Left = this.Width / 2 + 30; btn_w5.Left = btn_w.Left + btn_w.Width + 5; btn_z.Left = this.Width / 2 - 30 - btn_z.Width; btn_z5.Left = btn_z.Left - 5 - btn_z5.Width; //Liste anfertigen _liste = new int[SW.Statisch.GetMaxKIID()]; _eintraegeProSeite = 10; _counter = 0; //Menschliche Kontrahenten reinspeichern for (int i = 1; i <= SW.Dynamisch.GetAktivSpielerAnzahl(); i++) { if (i != SW.Dynamisch.GetAktiverSpieler()) //Der Spieler, der das Buch öffnet soll natürlich nicht selbst darin aufscheinen { _liste[_counter] = i; _mcounter++; _counter++; } } //KI Kontrahenten reinspeichern for (int i = SW.Statisch.GetMinKIID(); i < SW.Statisch.GetMaxKIID(); i++) { _liste[_counter] = i; _counter++; } _maxSeite = (_counter - 1) / _eintraegeProSeite; EintraegeAktualisieren(); }
public UntergebenenOptionen(int ID) { InitializeComponent(); Ueberschrift.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); btn_d1.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_d2.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); btn_d3.BackgroundImage = new Bitmap(Conspiratio.Properties.Resources.SymbUnchecked); OpferID = ID; lbl_text.Text = "Was wollt Ihr " + SW.Dynamisch.GetSpWithID(ID).GetName() + " antun?"; }
public UntergebeneForm() { InitializeComponent(); Ueberschrift.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); btn_d1.BackgroundImage = new Bitmap(Properties.Resources.SymbUnchecked); btn_d2.BackgroundImage = new Bitmap(Properties.Resources.SymbUnchecked); btn_d3.BackgroundImage = new Bitmap(Properties.Resources.SymbUnchecked); btn_d4.BackgroundImage = new Bitmap(Properties.Resources.SymbUnchecked); btn_d5.BackgroundImage = new Bitmap(Properties.Resources.SymbUnchecked); btn_d6.BackgroundImage = new Bitmap(Properties.Resources.SymbUnchecked); }
/// <summary> /// Anzeigen des Fensters /// </summary> /// <param name="mod"> /// Modus = In welchem Modus wird die Karte geoeffnet /// 0 = Beziehungen /// 1 = Sabotage /// 2 = Anschwärzen /// 3 = Spione /// 4 = Ermordung /// 5 = Erpressung /// 6 = Stadt auswaehlen /// 7 = Ehepartner waehlen /// 8 = Prozess initiieren /// 9 = Händler /// 10 = Kaufmann /// 11 = Merchant /// 12 = VergifteterWein /// 13 = Des Henkers Hand /// 14 !!!! gesperrt. Dieser wird von der Schreibstube aus bei der Liste der Kontrahenten verwendet /// </param> /// <param name="flaggenEinblenden"></param> public void ShowDialogModus(int mod, bool flaggenEinblenden = false) { modus = mod; if (flaggenEinblenden) { #region Flaggen einblenden for (int i = SW.Statisch.GetMinStadtID(); i < SW.Statisch.GetMaxStadtID(); i++) { this.Controls["btn_ban" + i.ToString()].Visible = false; // Wenn er ein Haus besitzt soll die Flagge angezeigt werden if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetSpielerHatHausVonStadtAnArraystelle(i).GetHausID() != 0) { Grafik.SwitchBanner("btn_ban" + i.ToString(), SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetBanner(), this); this.Controls["btn_ban" + i.ToString()].Visible = true; this.Controls["btn_ban" + i.ToString()].BringToFront(); } // oder wenn er eine Werkstaette besitzt else { for (int j = 1; j <= SW.Statisch.GetMaxWerkstaettenProStadt(); j++) { if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetSpielerHatInStadtXWerkstaettenY(j, i).GetSKillX(1) != 0) //Lagerraum { Grafik.SwitchBanner("btn_ban" + i.ToString(), SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetBanner(), this); this.Controls["btn_ban" + i.ToString()].Visible = true; this.Controls["btn_ban" + i.ToString()].BringToFront(); break; } } } } #endregion } else { if (modus == 10 || modus == 11) { Level = modus - 9; modus = 9; } if (modus == 6 || modus == 9 || modus == 12) { NurStaedteMarkieren = true; } } ShowDialog(); }
public GesetzeAnzeigen() { InitializeComponent(); this.Width += 100; lbl_mittelland.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); ControlZentrieren(lbl_mittelland, null, null); lbl_g1.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g2.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g3.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g4.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g5.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g6.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g7.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g8.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g9.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g10.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); lbl_g1.AutoSize = true; lbl_g2.AutoSize = true; lbl_g3.AutoSize = true; lbl_g4.AutoSize = true; lbl_g5.AutoSize = true; lbl_g6.AutoSize = true; lbl_g7.AutoSize = true; lbl_g8.AutoSize = true; lbl_g9.AutoSize = true; lbl_g10.AutoSize = true; btn_finanzen.BackgroundImage = new Bitmap(Properties.Resources.SymbFinanzen); btn_justiz.BackgroundImage = new Bitmap(Properties.Resources.SymbJustiz); btn_kirche.BackgroundImage = new Bitmap(Properties.Resources.SymbKirche); ControlZentrieren(btn_justiz, null, null); ControlZentrieren(btn_finanzen, null, btn_justiz); ControlZentrieren(btn_kirche, btn_justiz, null); _gesetzesebene = 0; _allgBewertung = new string[5]; _allgBewertung[0] = "sehr locker"; _allgBewertung[1] = "locker"; _allgBewertung[2] = "neutral"; _allgBewertung[3] = "repressiv"; _allgBewertung[4] = "sehr repressiv"; EbenePositionieren(_gesetzesebene); }
public Transport(int sid) { InitializeComponent(); lbl_text.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); btn_bild.BackgroundImage = new Bitmap(Properties.Resources.HintKaravane); txt_frage.Text = "Welche Karawane wollt Ihr mit \nEurem Transport beauftragen?"; lbl_text.Left = (this.Width - lbl_text.Width) / 2; _stadtID = sid; _aktuelleKaraID = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetKarawaneInStadtX(_stadtID); aktualisieren(); }
public NeuesSpiel() { InitializeComponent(); label1.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); setAnzSpieler(1); btn_c_aus.ForeColor = Color.Red; cheaten = false; btn_tf_aus.ForeColor = Color.Red; todesfaelle = false; btn_tm_aus.ForeColor = Color.Red; testmodus = false; }
public TitelVerleihForm() { InitializeComponent(); this.TransparencyKey = Color.White; lbl_ueberschrift.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); lbl_ueberschrift.Left = this.Width / 2 - lbl_ueberschrift.Width / 2; lbl_text.Left = this.Width / 2 - lbl_text.Width / 2; int verltitelid = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetBekamTitelX(); string text = "Wir, " + SW.Dynamisch.GetSpWithID(SW.Dynamisch.GetReichWithID(1).GetRegent()).GetKompletterName() + ", verfügen hiermit, dass Ihr, " + SW.Dynamisch.GetSpWithID(SW.Dynamisch.GetAktiverSpieler()).GetName() + ", Euch fortan\n\n\"" + SW.Statisch.GetTitelX(verltitelid).GetName(SW.Dynamisch.GetSpWithID(SW.Dynamisch.GetAktiverSpieler()).GetMaennlich()) + "\"\n\nnennen dürft.\n\n" + SW.Dynamisch.GetSpWithID(SW.Dynamisch.GetReichWithID(1).GetRegent()).GetKompletterName(); lbl_text.Text = text; SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).SetTitel(verltitelid); C_Musik musik = new C_Musik(); musik.PlaySound(Properties.Resources.fanfare); }
public RohstoffWaehlen(int r1, int r2) { InitializeComponent(); roh1 = r1; roh2 = r2; if (Grafik.GetRohstoffIcons80px().Count >= r1) { this.Controls["btn_roh1"].BackgroundImage = Grafik.GetRohstoffIcons80px()[r1]; ttRohstoffe.SetToolTip(this.Controls["btn_roh1"], SW.Dynamisch.GetRohstoffwithID(r1).GetRohName()); } if (Grafik.GetRohstoffIcons80px().Count >= r2) { this.Controls["btn_roh2"].BackgroundImage = Grafik.GetRohstoffIcons80px()[r2]; ttRohstoffe.SetToolTip(this.Controls["btn_roh2"], SW.Dynamisch.GetRohstoffwithID(r2).GetRohName()); } }
public KontrahentDetails(int spielerID) { InitializeComponent(); lbl_name.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); label2.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); _spielerID = spielerID; lbl_name.Text = SW.Dynamisch.GetSpWithID(_spielerID).GetName(); lbl_name.Left = (this.Width - lbl_name.Width) / 2; lbl_titel.Text = SW.Dynamisch.GetSpWithID(_spielerID).GetTitelGegendert(); lbl_alter.Text = SW.Dynamisch.GetSpWithID(_spielerID).GetAlter().ToString(); lbl_amt.Text = SW.Dynamisch.GetSpWithID(_spielerID).GetAmtNameUndOrt(); if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetAktiveSpionage(_spielerID).GetKosten() > 0 && SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetAktiveSpionage(_spielerID).GetDauer() > 1) { lbl_vermoe.Text = SW.Dynamisch.GetSpWithID(_spielerID).GetGesamtVermoegen(_spielerID).ToString(); lbl_ges.Text = SW.Dynamisch.GetSpWithID(_spielerID).BeurteileGesundheitString(); lbl_delikte.Text = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetAktiveSpionage(_spielerID).GetDelikte().ToString(); lbl_stand.Text = "Stand " + SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetAktiveSpionage(_spielerID).GetJahr().ToString(); lbl_stand.Visible = true; } }
private int NormH(int value) { return(Convert.ToInt32(value * this.Height / Grafik.GetNormBildschirmHoehe())); }
private int NormB(int value) { return(Convert.ToInt32(value * this.Width / Grafik.GetNormBildschirmBreite())); }
public Handelszertifikat(int rohid) { InitializeComponent(); lbl_ueberschrift.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); string text = ""; if (rohid < 8) { // Entweder die Stadt in der der Spieler das Amt innehat if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetAmtID() != 0 && SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetAmtID() < SW.Statisch.GetMaxAmtStadtID()) { text = " der Rat der Stadt " + SW.Dynamisch.GetStadtwithID(SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetAmtGebiet()).GetGebietsName(); } // oder die Stadt, in der er eine Niederlassung besitzt else { for (int i = SW.Statisch.GetMinStadtID(); i < SW.Statisch.GetMaxStadtID(); i++) { if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetSpielerHatHausVonStadtAnArraystelle(i).GetHausID() != 0) { text = " der Rat der Stadt " + SW.Dynamisch.GetStadtwithID(i).GetGebietsName(); } } } } else if (rohid < 15) { for (int i = 1; i < SW.Statisch.GetMaxLandID(); i++) { int LandStaedte = SW.Dynamisch.GetLandWithID(i).GetAnzahlStaedte(); int hauscounter = 0; for (int j = 0; j < LandStaedte; j++) { if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetSpielerHatHausVonStadtAnArraystelle(SW.Dynamisch.GetLandWithID(i).GetStadtX(j)).GetHausID() != 0) { hauscounter++; } } if (hauscounter >= 2) { text = " der Rat des Landes " + SW.Dynamisch.GetLandWithID(i).GetGebietsName(); break; } } if (string.IsNullOrEmpty(text)) { text = " der Rat des Reichs " + SW.Dynamisch.GetReichWithID(1).GetGebietsName(); } } else { text = " der Rat des Reichs " + SW.Dynamisch.GetReichWithID(1).GetGebietsName(); } lbl_text.Text = "Aufgrund Eurer besonderen\nHandelserfolge wird Euch,\n" + SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetName() + ",\n ab heute gestattet, auch mit\n" + SW.Dynamisch.GetRohstoffwithID(rohid).GetRohName() + " zu handeln.\n \n" + text; C_Musik musik = new C_Musik(); musik.PlaySound(Properties.Resources.fanfare); }
public Cheatbox() { InitializeComponent(); foreach (Control C in this.Controls) { try { C.Font = Grafik.GetStandardFont(Grafik.GetSchriftgKlein()); } catch { } } lbl_header_28.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); lbl_header_28.Left = (this.Width - lbl_header_28.Width) / 2; txt_goldd.Text = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetTaler().ToString(); txt_ans.Text = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetPermaAnsehen().ToString(); for (int i = 1; i < SW.Statisch.GetMaxRohID(); i++) { groupBox_1_16.Controls["ckb" + i.ToString()].Text = SW.Dynamisch.GetRohstoffwithID(i).GetRohName(); if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetRohstoffrechteX(i) == true) { switch (i) { case 1: ckb1.Checked = true; break; case 2: ckb2.Checked = true; break; case 3: ckb3.Checked = true; break; case 4: ckb4.Checked = true; break; case 5: ckb5.Checked = true; break; case 6: ckb6.Checked = true; break; case 7: ckb7.Checked = true; break; case 8: ckb8.Checked = true; break; case 9: ckb9.Checked = true; break; case 10: ckb10.Checked = true; break; case 11: ckb11.Checked = true; break; case 12: ckb12.Checked = true; break; case 13: ckb13.Checked = true; break; case 14: ckb14.Checked = true; break; case 15: ckb15.Checked = true; break; case 16: ckb16.Checked = true; break; case 17: ckb17.Checked = true; break; case 18: ckb18.Checked = true; break; case 19: ckb19.Checked = true; break; case 20: ckb20.Checked = true; break; case 21: ckb21.Checked = true; break; } groupBox_1_16.Controls["ckb" + i.ToString()].Enabled = false; } } //Amt übernehmen: Stufe for (int i = 0; i < 3; i++) { comboBox1.Items.Add((SW.Statisch.GetStufenNameX(i).ToString())); } //Haus bauen: Stadt for (int i = 1; i < SW.Statisch.GetMaxStadtID(); i++) { comboBox6.Items.Add(SW.Dynamisch.GetStadtwithID(i).GetGebietsName()); } }
/// <summary> /// Dient zur Erstellung der Listen mit verkleinerten Rohstoff-Bitmaps, welche in den Forms angezeigt werden können /// (bessere Performance, weniger Speicherverbrauch). /// </summary> private static void RohstoffIconsAufbereiten() { if (_rohstoffIcons46px == null) { _rohstoffIcons46px = new List <Bitmap>(); } if (_rohstoffIcons80px == null) { _rohstoffIcons80px = new List <Bitmap>(); } if (_rohstoffIcons100px == null) { _rohstoffIcons100px = new List <Bitmap>(); } if (_rohstoffIcons46px.Count == 0 || _rohstoffIcons80px.Count == 0 || _rohstoffIcons100px.Count == 0) { // Dummy an Index 0 hinzufügen, damit der Zugriff intuitiver wird (mit der RohstoffID, z.B. lstRohstoffIcons80px[rohID]) if (_rohstoffIcons46px.Count == 0) { _rohstoffIcons46px.Add(null); } if (_rohstoffIcons80px.Count == 0) { _rohstoffIcons80px.Add(null); } if (_rohstoffIcons100px.Count == 0) { _rohstoffIcons100px.Add(null); } string sPathImageCache = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Conspiratio", "imgcache"); if (!Directory.Exists(sPathImageCache)) { Directory.CreateDirectory(sPathImageCache); } for (int i = 1; i < SW.Statisch.GetMaxRohID(); i++) { bool bIconFileExists46 = false; bool bIconFileExists80 = false; bool bIconFileExists100 = false; string sFilenameIcon46 = Path.Combine(sPathImageCache, "Roh" + i.ToString() + "_46.png"); string sFilenameIcon80 = Path.Combine(sPathImageCache, "Roh" + i.ToString() + "_80.png"); string sFilenameIcon100 = Path.Combine(sPathImageCache, "Roh" + i.ToString() + "_100.png"); if (File.Exists(sFilenameIcon46)) { _rohstoffIcons46px.Add((Bitmap)Image.FromFile(sFilenameIcon46)); bIconFileExists46 = true; } if (File.Exists(sFilenameIcon80)) { _rohstoffIcons80px.Add((Bitmap)Image.FromFile(sFilenameIcon80)); bIconFileExists80 = true; } if (File.Exists(sFilenameIcon100)) { _rohstoffIcons100px.Add((Bitmap)Image.FromFile(sFilenameIcon100)); bIconFileExists100 = true; } if (!bIconFileExists46 || !bIconFileExists80 || !bIconFileExists100) { object oRohstoffImage = Properties.Resources.ResourceManager.GetObject("Roh" + i.ToString()); if (oRohstoffImage != null && oRohstoffImage is Bitmap) // Sicherheitsabfrage: ist ein gültiges Bitmap zurückgekommen? { if (!bIconFileExists46) { _rohstoffIcons46px.Add(Grafik.ResizeImage((Bitmap)oRohstoffImage, 46, 46)); _rohstoffIcons46px[i].Save(sFilenameIcon46, ImageFormat.Png); } if (!bIconFileExists80) { _rohstoffIcons80px.Add(Grafik.ResizeImage((Bitmap)oRohstoffImage, 80, 80)); _rohstoffIcons80px[i].Save(sFilenameIcon80, ImageFormat.Png); } if (!bIconFileExists100) { _rohstoffIcons100px.Add(Grafik.ResizeImage((Bitmap)oRohstoffImage, 100, 100)); _rohstoffIcons100px[i].Save(sFilenameIcon100, ImageFormat.Png); } } } } } }
public HausErweiterungen(int iStadtID) { InitializeComponent(); int iTopButton = 136; int iTopLabel = 131; int i = 0; _stadtID = iStadtID; _reduzierung = 1; if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).CheckPrivilegX(15)) { _reduzierung = ((PrivSparplan)SW.Statisch.GetPrivX(15)).FaktorReduzierung; } lbl_frage.Text = "Welche Erweiterung wollt Ihr an " + SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetSpielerHatHausVonStadtAnArraystelle(_stadtID).GetNameInklPronomen() + " anbauen?"; _hausErweiterungen = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetSpielerHatHausVonStadtAnArraystelle(_stadtID).GetFehlendeOderVorhandeneHauserweiterungen(); if (_hausErweiterungen.Count > 0) { // Alle nicht bereits vorhandenen Hauserweiterungen auslesen und anzeigen foreach (HausErweiterung oErweiterung in _hausErweiterungen) { #region Controls erstellen _btnErweiterungBauen = new CrystalButton(); _btnErweiterungBauen.BackColor = System.Drawing.Color.Transparent; _btnErweiterungBauen.BackgroundImageLayout = ImageLayout.Stretch; _btnErweiterungBauen.FlatAppearance.BorderSize = 0; _btnErweiterungBauen.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; _btnErweiterungBauen.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; _btnErweiterungBauen.FlatStyle = FlatStyle.Flat; _btnErweiterungBauen.Font = new System.Drawing.Font("Arial", 20.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); _btnErweiterungBauen.ForeColor = System.Drawing.Color.Black; _btnErweiterungBauen.Location = new System.Drawing.Point(55, iTopButton); _btnErweiterungBauen.Margin = new Padding(0); _btnErweiterungBauen.Name = "btnErweiterungBauen" + i.ToString(); _btnErweiterungBauen.Size = new System.Drawing.Size(20, 20); _btnErweiterungBauen.TabIndex = 223; _btnErweiterungBauen.UseVisualStyleBackColor = false; _btnErweiterungBauen.Tag = i; _btnErweiterungBauen.Click += new EventHandler(this.btnErweiterungBauen_Click); _btnErweiterungBauen.MouseDown += new MouseEventHandler(this.btnErweiterungBauen_MouseDown); _btnErweiterungBauen.BackgroundImage = Properties.Resources.SymbUnchecked; this.Controls.Add(_btnErweiterungBauen); _lblErweiterungBauen = new Label(); _lblErweiterungBauen.AutoSize = true; _lblErweiterungBauen.BackColor = System.Drawing.Color.Transparent; _lblErweiterungBauen.Font = Grafik.GetStandardFont(18); //new System.Drawing.Font("Arial", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); _lblErweiterungBauen.ForeColor = System.Drawing.Color.Black; _lblErweiterungBauen.Location = new System.Drawing.Point(87, iTopLabel); _lblErweiterungBauen.MaximumSize = new System.Drawing.Size(473, 0); _lblErweiterungBauen.Name = "lblErweiterungBauen" + i.ToString(); _lblErweiterungBauen.Size = new System.Drawing.Size(162, 29); _lblErweiterungBauen.TabIndex = 225; _lblErweiterungBauen.Text = oErweiterung.NameFuerKauf + " für " + Convert.ToInt32(oErweiterung.Kaufpreis * _reduzierung).ToStringGeld(); _lblErweiterungBauen.MouseDown += new MouseEventHandler(this.btnErweiterungBauen_MouseDown); this.Controls.Add(_lblErweiterungBauen); if (_lblErweiterungBauen.Height <= 29) { iTopButton += 35; iTopLabel += 35; } else { iTopButton += 70; iTopLabel += 70; } i++; #endregion } this.Height = iTopLabel + 40; } }
public StadtInformationen(int stadtid) { InitializeComponent(); lbl_ueberschrift.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); pct_c_1.BackgroundImage = Conspiratio.Properties.Resources.SymbCrime; pct_c_2.BackgroundImage = Conspiratio.Properties.Resources.SymbCrime; pct_c_3.BackgroundImage = Conspiratio.Properties.Resources.SymbCrime; pct_c_4.BackgroundImage = Conspiratio.Properties.Resources.SymbCrime; pct_c_5.BackgroundImage = Conspiratio.Properties.Resources.SymbCrime; pct_r_1.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_2.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_3.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_4.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_5.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_6.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_7.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_8.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_9.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_10.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_11.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_12.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_13.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; pct_r_14.BackgroundImage = Conspiratio.Properties.Resources.SymbReichtum; // Überschrift lbl_ueberschrift.Text = SW.Dynamisch.GetStadtwithID(stadtid).GetGebietsName(); lbl_ueberschrift.Left = (this.Width - lbl_ueberschrift.Width) / 2; // Einwohner lbl_einwohner.Text = SW.Dynamisch.GetStadtwithID(stadtid).GetEinwohner().ToString(); // Umsatzsteuer lbl_umsatz.Text = (SW.Dynamisch.GetStadtwithID(stadtid).GetUmsatzsteuer() * 100).ToString() + "%"; // Kriminalität int counter = SW.Dynamisch.GetStadtwithID(stadtid).GetKriminalitaet(); for (int i = 1; i <= counter; i++) { this.Controls["pct_c_" + i.ToString()].Visible = true; } // Hauptproduktion int[] produktion = SW.Dynamisch.GetStadtwithID(stadtid).GetHauptproduktion(6); for (int i = 1; i <= 3; i++) { if (Grafik.GetRohstoffIcons46px().Count >= produktion[i - 1]) { this.Controls["pct_hp_" + i.ToString()].BackgroundImage = Grafik.GetRohstoffIcons46px()[produktion[i - 1]]; ttRohstoffe.SetToolTip(this.Controls["pct_hp_" + i.ToString()], SW.Dynamisch.GetRohstoffwithID(produktion[i - 1]).GetRohName()); } } // Nebenproduktion for (int i = 3; i < 6; i++) { if (Grafik.GetRohstoffIcons46px().Count >= produktion[i]) { this.Controls["pct_nebenproduktion_" + (i - 2).ToString()].BackgroundImage = Grafik.GetRohstoffIcons46px()[produktion[i]]; ttRohstoffe.SetToolTip(this.Controls["pct_nebenproduktion_" + (i - 2).ToString()], SW.Dynamisch.GetRohstoffwithID(produktion[i]).GetRohName()); } } // Bedarf int[] np = SW.Dynamisch.GetStadtwithID(stadtid).GetBedarf(stadtid); for (int i = 1; i <= 3; i++) { if (Grafik.GetRohstoffIcons46px().Count >= np[i - 1]) { this.Controls["pct_np_" + i.ToString()].BackgroundImage = Grafik.GetRohstoffIcons46px()[np[i - 1]]; ttRohstoffe.SetToolTip(this.Controls["pct_np_" + i.ToString()], SW.Dynamisch.GetRohstoffwithID(np[i - 1]).GetRohName()); } } // Werkstätten für (Rohstoffe, die in der Stadt produziert werden können) int[] werkstaetten = SW.Dynamisch.GetStadtwithID(stadtid).GetRohstoffe(); for (int i = 1; i <= SW.Statisch.GetMaxWerkstaettenProStadt(); i++) { if (Grafik.GetRohstoffIcons46px().Count >= werkstaetten[i]) { this.Controls["pct_werkstatt_" + i.ToString()].BackgroundImage = Grafik.GetRohstoffIcons46px()[werkstaetten[i]]; ttRohstoffe.SetToolTip(this.Controls["pct_werkstatt_" + i.ToString()], SW.Dynamisch.GetRohstoffwithID(werkstaetten[i]).GetRohName()); } } // Lagerstand int[] lagerstand = SW.Dynamisch.BerechneAnteilRohstoffvorratImLand(stadtid); for (int i = 1; i < SW.Statisch.GetMaxRohID(); i++) { if (Grafik.GetRohstoffIcons46px().Count >= i) { ((PictureBox)this.Controls["pct_lagerstand_" + i.ToString()]).Image = Grafik.GetRohstoffIcons46px()[i]; ((PictureBox)this.Controls["pct_lagerstand_" + i.ToString()]).Padding = new Padding(3); if (lagerstand[i] <= 33) { this.Controls["pct_lagerstand_" + i.ToString()].BackColor = System.Drawing.Color.DarkRed; ttRohstoffe.SetToolTip(this.Controls["pct_lagerstand_" + i.ToString()], SW.Dynamisch.GetRohstoffwithID(i).GetRohName() + " (niedrig)"); } else if (lagerstand[i] <= 66) { this.Controls["pct_lagerstand_" + i.ToString()].BackColor = System.Drawing.Color.Orange; ttRohstoffe.SetToolTip(this.Controls["pct_lagerstand_" + i.ToString()], SW.Dynamisch.GetRohstoffwithID(i).GetRohName() + " (normal)"); } else { this.Controls["pct_lagerstand_" + i.ToString()].BackColor = System.Drawing.Color.DarkGreen; ttRohstoffe.SetToolTip(this.Controls["pct_lagerstand_" + i.ToString()], SW.Dynamisch.GetRohstoffwithID(i).GetRohName() + " (hoch)"); } } } ////Katastrohpen //int[] ks = SW.Dynamisch.getStadtwithID(stadtid).getKatastrophen(); //int k_count = 0; //for (int i = 0; i < SW.Dynamisch.getMaxKatastrohpen(); i++) //{ // if (ks[i] != 0) // { // SwitchKatastrophen("pct_kat_" + k_count.ToString(), i + 1); // //this.Controls["pct_kat_" + k_count.ToString()].Visible = true; // k_count++; // } //} // Reichtum int reich = SW.Dynamisch.GetStadtwithID(stadtid).GetReichtum(); for (int i = 1; i <= reich; i++) { this.Controls["pct_r_" + i.ToString()].Visible = true; if (reich <= 7) { this.Controls["pct_r_" + i.ToString()].Top += 13; } } }
public Abrechnung(ref Label lblgold) { InitializeComponent(); label1.Font = Grafik.GetStandardFont(Grafik.GetSchriftgRiesig()); _lblTaler = lblgold; int Gesamtkosten = 0; #region Arbeiter-, Betriebs- und Transportkosten int Arbeiterkosten = 0; int Betriebskosten = 0; int Transportkosten = 0; //Von jeder Stadt for (int i = 1; i < SW.Statisch.GetMaxStadtID(); i++) { //und jedem Slot berechnen for (int j = 0; j < SW.Statisch.GetMaxProdSlots(); j++) { if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetTaetigkeit() == 1) { int rohid = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetProduktionRohstoff(); int a_preis = SW.Dynamisch.GetRohstoffwithID(rohid).GetWSArbeiterpreis(); int a_kosten = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetProduktionArbeiter() * a_preis; Arbeiterkosten += a_kosten; a_kosten = 0; a_preis = 0; int p_preis = SW.Dynamisch.GetRohstoffwithID(rohid).GetWSEinzelpreis(); int p_kosten = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetProduktionStaetten() * p_preis; Betriebskosten += p_kosten; p_preis = 0; p_kosten = 0; } if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetTaetigkeit() == 2 || SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetTaetigkeit() == 3) { int anz_exp = 0; int kara_id = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetKarawaneInStadtX(i); int karaPreisPro100Stueck = SW.Statisch.GetKarawane(kara_id).PreisProStueck; int karaGrundPreis = SW.Statisch.GetKarawane(kara_id).Fixpreis; anz_exp = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetVerkaufAnzahl(); if (anz_exp != 0) { double d_bruch = (anz_exp - 1) / SW.Statisch.GetKarawane(kara_id).Kapazitaet; //anz_exp-1 weil: Damit bei 400 Waren noch 4 Karren und nicht 5 genommen werden double anz_fuhren = Convert.ToInt32(d_bruch) + 1; //Da immer abgerundet wird Transportkosten += Convert.ToInt32(karaGrundPreis + karaPreisPro100Stueck * anz_fuhren); } } } } Gesamtkosten += Arbeiterkosten; lbl_k_arbeiter.Text = Arbeiterkosten.ToStringGeld(false); Gesamtkosten += Betriebskosten; lbl_k_betriebs.Text = Betriebskosten.ToStringGeld(false); Gesamtkosten += Transportkosten; lbl_k_transport.Text = Transportkosten.ToStringGeld(false); #endregion #region Verkaufssteuern int verkaufssteuern = 0; for (int i = 1; i < SW.Statisch.GetMaxStadtID(); i++) { double umsatzsteuerInStadtI = SW.Dynamisch.GetStadtwithID(i).GetUmsatzsteuer(); int umsatzInStadtI = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetUmsatzInStadtX(i); verkaufssteuern += Convert.ToInt32(umsatzsteuerInStadtI * umsatzInStadtI); } double steuerhinterziehung = 0; if (SW.Dynamisch.GetAktHum().CheckPrivilegX(27) == true) { steuerhinterziehung = 0.2; } if (SW.Dynamisch.GetAktHum().CheckPrivilegX(28) == true) { steuerhinterziehung = 0.4; } if (SW.Dynamisch.GetAktHum().CheckPrivilegX(29) == true) { steuerhinterziehung = 0.6; } Gesamtkosten += Convert.ToInt32(verkaufssteuern * (1 - steuerhinterziehung)); lbl_k_verkaufssteuern.Text = verkaufssteuern.ToStringGeld(false); #endregion #region Informanten int Informantenkosten = 0; for (int i = 1; i < SW.Statisch.GetMaxKIID(); i++) { Informantenkosten += SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetAktiveSpionage(i).GetKosten(); } Gesamtkosten += Informantenkosten; lbl_k_Informanten.Text = Informantenkosten.ToStringGeld(false); #endregion #region Saboteure int Saboteurekosten = 0; for (int i = 1; i < SW.Statisch.GetMaxKIID(); i++) { Saboteurekosten += SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetAktiveSabotage(i).GetKosten(); } Gesamtkosten += Saboteurekosten; lbl_k_Saboteure.Text = Saboteurekosten.ToStringGeld(false); #endregion #region Kreditzinsen int Kreditzinsenkosten = 0; for (int i = 0; i < SW.Statisch.GetMaxKredite(); i++) { if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetKreditMitID(i).GetTaler() != 0) { int goldstke = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetKreditMitID(i).GetTaler(); double zins = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetKreditMitID(i).GetZinsen(); zins = zins / 100; double tsum = goldstke * zins; Kreditzinsenkosten += Convert.ToInt32(tsum); } } lbl_k_kreditzinsen.Text = Kreditzinsenkosten.ToStringGeld(false); Gesamtkosten += Kreditzinsenkosten; #endregion #region Kirchenzehnt int Kirchenzehntkosten = 0; int GesamtUmsatz = 0; if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).CheckPrivilegX(16) == false) { for (int i = 1; i < SW.Statisch.GetMaxStadtID(); i++) { GesamtUmsatz += SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetUmsatzInStadtX(i); } } Kirchenzehntkosten = Convert.ToInt32(SW.Statisch.GetKirchenzehnt() * GesamtUmsatz); lbl_k_kirchenzehnt.Text = Kirchenzehntkosten.ToStringGeld(false); Gesamtkosten += Kirchenzehntkosten; #endregion #region Zoelle int zollkosten = 0; for (int j = 0; j < SW.Statisch.GetMaxProdSlots(); j++) { for (int i = 1; i < SW.Statisch.GetMaxStadtID(); i++) { //Überprüfen ob Exportieren eingestellt ist if (SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetTaetigkeit() == 2 || SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetTaetigkeit() == 3) { //Exportierter Rohstoff in Stadt i int rohNr = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetVerkaufRohstoff(); //Rohstoff mit rohNr wurde exportiert int anzahl = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetVerkaufAnzahl(); int zielstadt = SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).GetProduktionsslot(i, j).GetVerkaufStadt(); //Zollkosten berechnen int startland = SW.Dynamisch.GetStadtwithID(i).GetLandID(); int zielland = SW.Dynamisch.GetStadtwithID(zielstadt).GetLandID(); int rohgrundpreis = SW.Dynamisch.GetRohstoffwithID(rohNr).GetPreisStd(); int grundumsatz = rohgrundpreis * anzahl; //Dann wird mindestens eine Grenze überschritten if (startland != zielland) { double zollsatz1 = SW.Dynamisch.GetZollburgWithIDx(SW.Dynamisch.GetLandWithID(startland).GetZollburgIndex()).Zoll; double zollsatz2 = SW.Dynamisch.GetZollburgWithIDx(SW.Dynamisch.GetLandWithID(zielland).GetZollburgIndex()).Zoll; if (SW.Dynamisch.GetZollburgWithIDx(SW.Dynamisch.GetLandWithID(startland).GetZollburgIndex()).Besitzer == SW.Dynamisch.GetAktiverSpieler()) { zollsatz1 = 0; } else { SW.Dynamisch.GetSpWithID(SW.Dynamisch.GetZollburgWithIDx(SW.Dynamisch.GetLandWithID(startland).GetZollburgIndex()).Besitzer).ErhoeheTaler(Convert.ToInt32(zollsatz1 * grundumsatz)); } if (SW.Dynamisch.GetZollburgWithIDx(SW.Dynamisch.GetLandWithID(zielland).GetZollburgIndex()).Besitzer == SW.Dynamisch.GetAktiverSpieler()) { zollsatz2 = 0; } else { SW.Dynamisch.GetSpWithID(SW.Dynamisch.GetZollburgWithIDx(SW.Dynamisch.GetLandWithID(zielland).GetZollburgIndex()).Besitzer).ErhoeheTaler(Convert.ToInt32(zollsatz2 * grundumsatz)); } double geszollsatz = zollsatz1 + zollsatz2; zollkosten += Convert.ToInt32(geszollsatz * grundumsatz); } } } } //Privilegien if (SW.Dynamisch.GetAktHum().CheckPrivilegX(23) == true) { zollkosten = 0; } if (SW.Dynamisch.GetAktHum().CheckPrivilegX(31) == true) { if (SW.Statisch.Rnd.Next(0, 2) == 0) { zollkosten = 0; } } Gesamtkosten += zollkosten; lbl_k_zoelle.Text = zollkosten.ToStringGeld(false); for (int i = 1; i < SW.Statisch.GetMaxStadtID(); i++) { SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).SetUmsatzInStadtX(0, i); } #endregion #region Sold int Sold = 0; foreach (Stuetzpunkt oStuetzpunkt in SW.Dynamisch.GetStuetzpunkte()) { if (oStuetzpunkt.Besitzer == SW.Dynamisch.GetAktiverSpieler()) { foreach (Einheit oEinheit in oStuetzpunkt.Einheiten) { Sold += oEinheit.Basispreis; } } } lbl_k_sold.Text = Sold.ToStringGeld(false); Gesamtkosten += Sold; #endregion #region Gesamtkosten lbl_k_gesamt.Text = Gesamtkosten.ToStringGeld(false); UI.TalerAendern(-Gesamtkosten, ref lblgold); #endregion #region Umsaetze des Spielers wieder auf 0 setzen for (int i = 1; i < SW.Statisch.GetMaxStadtID(); i++) { SW.Dynamisch.GetHumWithID(SW.Dynamisch.GetAktiverSpieler()).SetUmsatzInStadtX(0, i); } #endregion }