- Timestamp:
- 2013-09-14 16:39:42 (9 years ago)
- Location:
- 2012/09-22/SanteriH/Kynari
- Files:
-
- 1 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/09-22/SanteriH/Kynari/Kynari/Kynari/Kynari.cs
r4418 r4757 37 37 string HP = "Päällä"; 38 38 string SailytaAse = "Kyllä"; 39 string ase = null; 40 string ase2 = null; 39 41 int PISTEMAARA_JOLLA_VOITTAA_PELIN = 3; 40 42 int PHPMAARA = 100; 41 43 int HPBOOST = 25; 44 int HPBOOSTSINGLE = 25; 42 45 int kentta = 1; 43 46 int taso = 0; 44 47 int powerupmaara = 0; 45 48 int hpmaara = 0; 46 intCURRENTHP = 100;47 intMAXHP = 100;49 double CURRENTHP = 100; 50 double MAXHP = 100; 48 51 49 52 Pelaaja pelaaja1 = new Pelaaja(40, 40, Shape.Circle); … … 53 56 Image portaalikuva = LoadImage("portal"); 54 57 Image hpkuva = LoadImage("health"); 58 Image hpboostkuva = LoadImage("boost"); 55 59 Image kranaatinheittimenkuva = LoadImage("grenadelauncher"); 56 60 Image kranaatinheittimenkuva2 = LoadImage("grenadelauncher2"); … … 95 99 Image target = LoadImage("target"); 96 100 Image powerupinkuva = LoadImage("upgrade"); 101 Image sidegradekuva = LoadImage("sideupgrade"); 97 102 Image flaregunkuva = LoadImage("flaregun"); 103 Image flaregunkuva2 = LoadImage("flaregun2"); 104 Image flaregunkuva3 = LoadImage("flaregun3"); 105 Image flaregunkuva4 = LoadImage("flaregun4"); 98 106 Image flarekuva = LoadImage("flare"); 107 Image flarekuva2 = LoadImage("flare2"); 108 Image flarekuva3 = LoadImage("flare3"); 109 Image flarekuva4 = LoadImage("flare4"); 110 Image konepistoolinkuva = LoadImage("smg"); 99 111 100 112 bool saaAmpua = false; 101 113 bool tasapeli = false; 114 bool sailytahp = false; 102 115 103 116 SoundEffect hyppyAani = LoadSoundEffect("hyppays"); 117 SoundEffect portalAani = LoadSoundEffect("maali"); 104 118 105 119 ProgressBar hpNaytto; … … 157 171 ruudut.SetTileMethod('c', LuoSeina); 158 172 ruudut.SetTileMethod('.', LuoKohde); 173 ruudut.SetTileMethod(',', LuoPoltettavaTaso); 159 174 ruudut.SetTileMethod('w', LuoPortaali); 160 175 ruudut.SetTileMethod('p', LuoTutorialAse, new Vector(16, 11), "Pistooli", pistoolinkuva); 161 176 ruudut.SetTileMethod('f', LuoTutorialAse, new Vector(18, 10), "Valopistooli", flaregunkuva); 162 177 ruudut.SetTileMethod('v', LuoNorsuVihu, "Pistooli"); 178 ruudut.SetTileMethod('i', LuoNorsuVihu, "Valopistooli"); 163 179 ruudut.SetTileMethod('a', LuoNorsuVihu, "Kivääri"); 164 //ruudut.SetTileMethod('m', LuoAse, new Vector(24, 24), "Miekka", miekankuva);180 ruudut.SetTileMethod('m', LuoAse, new Vector(24, 24), "Miekka", miekankuva); 165 181 ruudut.SetTileMethod('+', LuoPowerUp1, new Vector(16, 20), "Power Up", powerupinkuva); 166 ruudut.SetTileMethod('h', LuoHP1, new Vector(16, 20), "HP", hpkuva); 182 ruudut.SetTileMethod('-', LuoUpgrade1, new Vector(16, 20), "Upgrade", sidegradekuva); 183 ruudut.SetTileMethod('h', LuoHP1, new Vector(20, 21), "HP", hpkuva); 184 ruudut.SetTileMethod('*', LuoHPIncrease, new Vector(20, 21), "HP Boost", hpboostkuva); 167 185 ruudut.SetTileMethod('P', LuoAse, new Vector(16, 11), "Pistooli", pistoolinkuva); 168 186 ruudut.SetTileMethod('A', LuoAse, new Vector(39, 13), "Kivääri", kivaarinkuva); … … 223 241 timer.Start(); 224 242 225 if (PowerUpit == "Päällä" )243 if (PowerUpit == "Päällä" && kentta != 0) 226 244 { 227 245 Timer poweruptimer = new Timer(); … … 247 265 } 248 266 249 if (HP == "Päällä" )267 if (HP == "Päällä" && kentta != 0) 250 268 { 251 269 Timer hptimer = new Timer(); … … 303 321 } 304 322 323 void LuoPoltettavaTaso(Vector paikka, double leveys, double korkeus) 324 { 325 PhysicsObject taso = new PhysicsObject(leveys, korkeus * 2); 326 taso.Position = paikka + new Vector(0, -korkeus * 0.5); 327 taso.Color = Color.DarkForestGreen; 328 taso.Tag = "poltettava taso"; 329 taso.MakeStatic(); 330 Add(taso); 331 } 332 305 333 void LuoPortaali(Vector paikka, double leveys, double korkeus) 306 334 { … … 383 411 if (asetag == "Pistooli") 384 412 { 385 AddCollisionHandler<PhysicsObject, Pelaaja>(ase, "pelaaja", delegate { LuoAsePelaajalle(asetag, pelaaja1); ase.Destroy(); MessageDisplay.Add("Ammu: Space / RT"); });413 AddCollisionHandler<PhysicsObject, Pelaaja>(ase, "pelaaja", delegate { PudotaAseenHahmo(pelaaja1); LuoAsePelaajalle(asetag, pelaaja1); ase.Destroy(); MessageDisplay.Add("Ammu: Space / RT"); }); 386 414 } 387 415 if (asetag == "Valopistooli") 388 416 { 389 AddCollisionHandler<PhysicsObject, Pelaaja>(ase, "pelaaja", delegate { if (pelaaja1.varaAse != null) { LuoAsePelaajalle(pelaaja1.varaAse, pelaaja1); } LuoVaraAse(asetag, pelaaja1); ase.Destroy(); MessageDisplay.Add("Vaihda asetta: E / LT"); }); 390 } 417 AddCollisionHandler<PhysicsObject, Pelaaja>(ase, "pelaaja", delegate { if (pelaaja1.Weapon != null && pelaaja1.Weapon.Tag != null) { string aseentag = pelaaja1.Weapon.Tag.ToString(); pelaaja1.Clear(); if (pelaaja1.varaAse != null) { PudotaAseenHahmo(pelaaja1); LuoAsePelaajalle(pelaaja1.varaAse, pelaaja1); } else { LuoAsePelaajalle(aseentag, pelaaja1); } } else if (pelaaja1.varaAse != null) { pelaaja1.Clear(); LuoAsePelaajalle(pelaaja1.varaAse, pelaaja1); } LuoVaraAse(asetag, pelaaja1); ase.Destroy(); MessageDisplay.Add("Vaihda asetta: E / LT"); }); 418 } 419 } 420 421 void PoltaTaso(PhysicsObject taso) 422 { 423 GameObject liekki = new GameObject(34, 64); 424 liekki.Color = new Color(Color.Orange, 150); 425 liekki.Shape = Shape.Rectangle; 426 427 taso.Add(liekki); 428 Timer.SingleShot(1.0, delegate { taso.Remove(liekki); taso.Destroy(); }); 391 429 } 392 430 … … 826 864 { 827 865 Pelaaja pelaaja = tormaaja as Pelaaja; 828 if (taso == 0) { LuoTaso1(); } 866 867 ase = null; 868 ase2 = null; 869 sailytahp = true; 870 871 if (pelaaja1.Weapon != null && pelaaja1.Weapon.Tag != null) 872 { 873 ase = pelaaja1.Weapon.Tag.ToString(); 874 if (ase.Length > 6 && ase.Substring(ase.Length - 5) == "Lv. 4") 875 { 876 ase = ase.Substring(0, ase.Length - 5) + "Lv. 3"; 877 } 878 879 } 880 if (pelaaja1.varaAse != null) 881 { 882 ase2 = pelaaja1.varaAse; 883 if (ase2.Length > 6 && ase2.Substring(ase2.Length - 5) == "Lv. 4") 884 { 885 ase2 = ase2.Substring(0, ase2.Length - 5) + "Lv. 3"; 886 } 887 888 } 889 890 if (kohde != null) portalAani.Play(); 891 892 if (taso == 0) { LuoTaso1(); return; } 893 else if (taso == 1) { LuoTaso2(); return; } 894 else sailytahp = false; 829 895 } 830 896 … … 832 898 { 833 899 taso = 0; 900 ase = null; 901 ase2 = null; 834 902 uusiYksinPeli(); 835 903 } … … 844 912 taso = 2; 845 913 uusiYksinPeli(); 914 } 915 916 void LuoKentta0() 917 { 918 kentta = 0; 919 uusiPeli(); 846 920 } 847 921 … … 1015 1089 Pelaaja LuoYksinPelaaja(Vector paikka, double leveys, double korkeus, Direction suunta, Pelaaja pelaaja) 1016 1090 { 1017 string ase = null;1018 string ase2 = null;1019 if (pelaaja.Weapon != null && pelaaja.Weapon.Tag != null && taso != 0)1020 {1021 ase = pelaaja.Weapon.Tag.ToString();1022 if (ase.Length > 6 && ase.Substring(ase.Length - 5) == "Lv. 4")1023 {1024 ase = ase.Substring(0, ase.Length - 5) + "Lv. 3";1025 }1026 1027 }1028 if (pelaaja.varaAse != null && taso != 0)1029 {1030 ase2 = pelaaja.varaAse;1031 if (ase2.Length > 6 && ase2.Substring(ase2.Length - 5) == "Lv. 4")1032 {1033 ase2 = ase2.Substring(0, ase2.Length - 5) + "Lv. 3";1034 }1035 1036 }1037 1038 1091 pelaaja = new Pelaaja(40, 40, Shape.Circle); 1039 1092 pelaaja.Image = norsu; … … 1053 1106 LuoAsePelaajalle(ase, pelaaja); 1054 1107 LuoVaraAse(ase2, pelaaja); 1108 1055 1109 return pelaaja; 1056 1110 } … … 1179 1233 } 1180 1234 1235 void keraaUpgrade(PhysicsObject upgrade, Pelaaja pelaaja) 1236 { 1237 if (pelaaja.Weapon == null || pelaaja.Weapon.Tag == null) return; 1238 upgrade.Destroy(); 1239 MuunnaAse(pelaaja.Weapon.Tag.ToString(), pelaaja); 1240 naytaTiedot(); 1241 } 1242 1181 1243 void keraaHP(PhysicsObject hp, Pelaaja pelaaja) 1182 1244 { … … 1184 1246 hpmaara -= 1; 1185 1247 BoostiHP(pelaaja); 1248 } 1249 1250 void keraaHP1(PhysicsObject hp, Pelaaja pelaaja) 1251 { 1252 hp.Destroy(); 1253 hpmaara -= 1; 1254 BoostiHP1(pelaaja); 1255 } 1256 1257 void keraaHPBoost(PhysicsObject hpboost, Pelaaja pelaaja) 1258 { 1259 hpboost.Destroy(); 1260 IncreaseHP(pelaaja); 1186 1261 } 1187 1262 … … 1199 1274 } 1200 1275 1276 void BoostiHP1(Pelaaja pelaaja) 1277 { 1278 if (pelaaja.HPLaskuri.Value == pelaaja.HPLaskuri.MaxValue && pelaaja.DamageResistance == false) 1279 { 1280 GameObject kilpi = new GameObject(60, 60, Shape.Circle); 1281 kilpi.Color = new Color(Color.Blue, 50); 1282 pelaaja.Add(kilpi); 1283 pelaaja.DamageResistance = true; 1284 Timer.SingleShot(5.0, delegate { pelaaja.DamageResistance = false; pelaaja.Remove(kilpi); }); 1285 } 1286 pelaaja.HPLaskuri.Value += HPBOOSTSINGLE; 1287 } 1288 1289 void IncreaseHP(Pelaaja pelaaja) 1290 { 1291 pelaaja.HPLaskuri.MaxValue += 25; 1292 pelaaja.HPLaskuri.Value = pelaaja.HPLaskuri.MaxValue; 1293 } 1294 1201 1295 void vaihdaAse(Pelaaja pelaaja) 1202 1296 { 1297 if (pelaaja.IsDestroyed == true) return; 1203 1298 if (pelaaja.Weapon == null || pelaaja.Weapon.IsDestroyed || pelaaja.Weapon.Tag == null) 1204 1299 { … … 1429 1524 { 1430 1525 aseenKuva = flaregunkuva; 1526 aseenKoko = new Vector(18, 10); 1527 } 1528 1529 if (aseenTag == "Valopistooli Lv. 2") 1530 { 1531 aseenKuva = flaregunkuva2; 1532 aseenKoko = new Vector(18, 10); 1533 } 1534 1535 if (aseenTag == "Valopistooli Lv. 3") 1536 { 1537 aseenKuva = flaregunkuva3; 1538 aseenKoko = new Vector(18, 10); 1539 } 1540 1541 if (aseenTag == "Valopistooli Lv. 4") 1542 { 1543 aseenKuva = flaregunkuva4; 1431 1544 aseenKoko = new Vector(18, 10); 1432 1545 } … … 1677 1790 } 1678 1791 1792 void FlarePaineaaltoOsuu(IPhysicsObject kohde, Vector shokki, Explosion e) 1793 { 1794 if (!(kohde is Pelaaja)) return; 1795 Pelaaja p = (Pelaaja)kohde; 1796 if (p.ViimeisinRajahdys == e) return; 1797 p.ViimeisinRajahdys = e; 1798 if (p.DamageResistance == true) 1799 { 1800 GameObject liekki = new GameObject(40, 40); 1801 liekki.Color = new Color(Color.Orange, 100); 1802 liekki.Shape = Shape.FromImage(norsu); 1803 1804 p.Add(liekki); 1805 Timer.SingleShot(2.5, delegate { p.Remove(liekki); }); 1806 1807 p.HPLaskuri.Value -= 5; 1808 Timer.SingleShot(0.5, delegate 1809 { 1810 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1811 Timer.SingleShot(0.5, delegate 1812 { 1813 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1814 Timer.SingleShot(0.5, delegate 1815 { 1816 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1817 Timer.SingleShot(0.5, delegate 1818 { 1819 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1820 Timer.SingleShot(0.5, delegate 1821 { 1822 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1823 }); 1824 }); 1825 }); 1826 }); 1827 }); 1828 } 1829 else 1830 { 1831 GameObject liekki = new GameObject(40, 40); 1832 liekki.Color = new Color(Color.Orange, 100); 1833 liekki.Shape = Shape.FromImage(norsu); 1834 1835 p.Add(liekki); 1836 Timer.SingleShot(2.5, delegate { p.Remove(liekki); }); 1837 1838 p.HPLaskuri.Value -= 10; 1839 Timer.SingleShot(0.5, delegate 1840 { 1841 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1842 Timer.SingleShot(0.5, delegate 1843 { 1844 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1845 Timer.SingleShot(0.5, delegate 1846 { 1847 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1848 Timer.SingleShot(0.5, delegate 1849 { 1850 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1851 Timer.SingleShot(0.5, delegate 1852 { 1853 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1854 }); 1855 }); 1856 }); 1857 }); 1858 }); 1859 } 1860 } 1861 1679 1862 bool AmmusVoiOsua(PhysicsObject ammus, PhysicsObject kohde) 1680 1863 { … … 1851 2034 if (p.DamageResistance == true) 1852 2035 { 1853 p.HPLaskuri.Value -= 17;2036 p.HPLaskuri.Value -= 26; 1854 2037 } 1855 2038 else … … 1866 2049 if (p.DamageResistance == true) 1867 2050 { 1868 p.HPLaskuri.Value -= 20;2051 p.HPLaskuri.Value -= 30; 1869 2052 } 1870 2053 else … … 1881 2064 if (p.DamageResistance == true) 1882 2065 { 1883 p.HPLaskuri.Value -= 25;2066 p.HPLaskuri.Value -= 37; 1884 2067 } 1885 2068 else … … 1896 2079 if (p.DamageResistance == true) 1897 2080 { 1898 p.HPLaskuri.Value -= 50;2081 p.HPLaskuri.Value -= 75; 1899 2082 } 1900 2083 else … … 2002 2185 } 2003 2186 } 2187 } 2188 2189 void FlareOsui2(PhysicsObject ammus, PhysicsObject kohde) 2190 { 2191 if (AmmusVoiOsua(ammus, kohde)) 2192 { 2193 Pelaaja p = (Pelaaja)kohde; 2194 if (p.DamageResistance == true) 2195 { 2196 GameObject liekki = new GameObject(40, 40); 2197 liekki.Color = new Color(Color.Orange, 100); 2198 liekki.Shape = Shape.FromImage(norsu); 2199 2200 p.Add(liekki); 2201 Timer.SingleShot(2.0, delegate { p.Remove(liekki); }); 2202 2203 p.HPLaskuri.Value -= 10; 2204 Timer.SingleShot(0.5, delegate 2205 { 2206 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2207 Timer.SingleShot(0.5, delegate 2208 { 2209 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2210 Timer.SingleShot(0.5, delegate 2211 { 2212 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2213 Timer.SingleShot(0.5, delegate 2214 { 2215 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2216 }); 2217 }); 2218 }); 2219 }); 2220 } 2221 else 2222 { 2223 GameObject liekki = new GameObject(40, 40); 2224 liekki.Color = new Color(Color.Orange, 100); 2225 liekki.Shape = Shape.FromImage(norsu); 2226 2227 p.Add(liekki); 2228 Timer.SingleShot(2.0, delegate { p.Remove(liekki); }); 2229 2230 p.HPLaskuri.Value -= 20; 2231 Timer.SingleShot(0.5, delegate 2232 { 2233 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2234 Timer.SingleShot(0.5, delegate 2235 { 2236 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2237 Timer.SingleShot(0.5, delegate 2238 { 2239 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2240 Timer.SingleShot(0.5, delegate 2241 { 2242 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2243 }); 2244 }); 2245 }); 2246 }); 2247 2248 } 2249 } 2250 } 2251 void FlareOsui3(PhysicsObject ammus, PhysicsObject kohde) 2252 { 2253 if (AmmusVoiOsua(ammus, kohde)) 2254 { 2255 Pelaaja p = (Pelaaja)kohde; 2256 if (p.DamageResistance == true) 2257 { 2258 GameObject liekki = new GameObject(40, 40); 2259 liekki.Color = new Color(Color.Orange, 100); 2260 liekki.Shape = Shape.FromImage(norsu); 2261 2262 p.Add(liekki); 2263 Timer.SingleShot(2.5, delegate { p.Remove(liekki); }); 2264 2265 p.HPLaskuri.Value -= 15; 2266 Timer.SingleShot(0.5, delegate 2267 { 2268 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2269 Timer.SingleShot(0.5, delegate 2270 { 2271 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2272 Timer.SingleShot(0.5, delegate 2273 { 2274 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2275 Timer.SingleShot(0.5, delegate 2276 { 2277 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2278 Timer.SingleShot(0.5, delegate 2279 { 2280 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2281 }); 2282 }); 2283 }); 2284 }); 2285 }); 2286 } 2287 else 2288 { 2289 GameObject liekki = new GameObject(40, 40); 2290 liekki.Color = new Color(Color.Orange, 100); 2291 liekki.Shape = Shape.FromImage(norsu); 2292 2293 p.Add(liekki); 2294 Timer.SingleShot(2.5, delegate { p.Remove(liekki); }); 2295 2296 p.HPLaskuri.Value -= 30; 2297 Timer.SingleShot(0.5, delegate 2298 { 2299 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2300 Timer.SingleShot(0.5, delegate 2301 { 2302 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2303 Timer.SingleShot(0.5, delegate 2304 { 2305 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2306 Timer.SingleShot(0.5, delegate 2307 { 2308 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2309 Timer.SingleShot(0.5, delegate 2310 { 2311 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2312 }); 2313 }); 2314 }); 2315 }); 2316 }); 2317 } 2318 } 2319 } 2320 2321 void FlareOsui4(PhysicsObject ammus, PhysicsObject kohde) 2322 { 2323 if (AmmusVoiOsua(ammus, kohde)) 2324 { 2325 Pelaaja p = (Pelaaja)kohde; 2326 if (p.DamageResistance == true) 2327 { 2328 GameObject liekki = new GameObject(40, 40); 2329 liekki.Color = new Color(Color.Red, 100); 2330 liekki.Shape = Shape.FromImage(norsu); 2331 2332 p.Add(liekki); 2333 Timer.SingleShot(5.0, delegate { p.Remove(liekki); }); 2334 2335 p.HPLaskuri.Value -= 17; 2336 Timer.SingleShot(0.5, delegate 2337 { 2338 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2339 Timer.SingleShot(0.5, delegate 2340 { 2341 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2342 Timer.SingleShot(0.5, delegate 2343 { 2344 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2345 Timer.SingleShot(0.5, delegate 2346 { 2347 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2348 Timer.SingleShot(0.5, delegate 2349 { 2350 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2351 Timer.SingleShot(0.5, delegate 2352 { 2353 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2354 Timer.SingleShot(0.5, delegate 2355 { 2356 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2357 Timer.SingleShot(0.5, delegate 2358 { 2359 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2360 Timer.SingleShot(0.5, delegate 2361 { 2362 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2363 Timer.SingleShot(0.5, delegate 2364 { 2365 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2366 }); 2367 }); 2368 }); 2369 }); 2370 }); 2371 }); 2372 }); 2373 }); 2374 }); 2375 }); 2376 } 2377 else 2378 { 2379 GameObject liekki = new GameObject(40, 40); 2380 liekki.Color = new Color(Color.Red, 100); 2381 liekki.Shape = Shape.FromImage(norsu); 2382 2383 p.Add(liekki); 2384 Timer.SingleShot(5.0, delegate { p.Remove(liekki); }); 2385 2386 p.HPLaskuri.Value -= 35; 2387 Timer.SingleShot(0.5, delegate 2388 { 2389 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2390 Timer.SingleShot(0.5, delegate 2391 { 2392 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2393 Timer.SingleShot(0.5, delegate 2394 { 2395 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2396 Timer.SingleShot(0.5, delegate 2397 { 2398 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2399 Timer.SingleShot(0.5, delegate 2400 { 2401 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2402 Timer.SingleShot(0.5, delegate 2403 { 2404 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2405 Timer.SingleShot(0.5, delegate 2406 { 2407 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2408 Timer.SingleShot(0.5, delegate 2409 { 2410 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2411 Timer.SingleShot(0.5, delegate 2412 { 2413 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2414 Timer.SingleShot(0.5, delegate 2415 { 2416 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2417 }); 2418 }); 2419 }); 2420 }); 2421 }); 2422 }); 2423 }); 2424 }); 2425 }); 2426 }); 2427 } 2428 } 2429 } 2430 2431 // Muunnetut aseet 2432 2433 void SarjatulikivaariOsui(PhysicsObject ammus, PhysicsObject kohde) 2434 { 2435 if (AmmusVoiOsua(ammus, kohde)) 2436 { 2437 Pelaaja p = (Pelaaja)kohde; 2438 if (p.DamageResistance == true) 2439 { 2440 p.HPLaskuri.Value -= 7; 2441 } 2442 else 2443 { 2444 p.HPLaskuri.Value -= 15; 2445 } 2446 } 2447 } 2448 2449 void RevolveriOsui(PhysicsObject ammus, PhysicsObject kohde) 2450 { 2451 if (AmmusVoiOsua(ammus, kohde)) 2452 { 2453 Pelaaja p = (Pelaaja)kohde; 2454 if (p.DamageResistance == true) 2455 { 2456 p.HPLaskuri.Value -= 30; 2457 } 2458 else 2459 { 2460 p.HPLaskuri.Value -= 40; 2461 } 2462 } 2463 } 2464 2465 void KatkaistuHaulikkoOsui(PhysicsObject ammus, PhysicsObject kohde) 2466 { 2467 if (AmmusVoiOsua(ammus, kohde)) 2468 { 2469 Pelaaja p = (Pelaaja)kohde; 2470 if (p.DamageResistance == true) 2471 { 2472 p.HPLaskuri.Value -= 6; 2473 } 2474 else 2475 { 2476 p.HPLaskuri.Value -= 13; 2477 } 2478 } 2479 } 2480 2481 void PanssariSniperOsui(PhysicsObject ammus, PhysicsObject kohde) 2482 { 2483 if (AmmusVoiOsua(ammus, kohde)) 2484 { 2485 Pelaaja p = (Pelaaja)kohde; 2486 if (p.DamageResistance == true) 2487 { 2488 p.HPLaskuri.Value -= 100; 2489 } 2490 else 2491 { 2492 p.HPLaskuri.Value -= 200; 2493 } 2494 } 2495 } 2496 2497 void SirpaleKranaattiOsui(PhysicsObject ammus, PhysicsObject kohde) 2498 { 2499 if (ammus.IsDestroying) return; 2500 if (kohde.Tag.ToString() != "") 2501 { 2502 Explosion rajahdys = new Explosion(75); 2503 rajahdys.Position = ammus.Position; 2504 rajahdys.ShockwaveReachesObject += delegate(IPhysicsObject p, Vector shokki) { PaineaaltoOsuu(p, shokki, rajahdys, 50.0); }; 2505 Add(rajahdys); 2506 rajahdys.Force = 25; 2507 rajahdys.Speed = 1000; 2508 2509 ammus.Destroy(); // ei voi taata tapahtuuko tämä "heti". Siksi tarvitaan alkuun tarkistus, että onko ammus tuhoutumassa. 2510 if (!(kohde is Pelaaja)) return; 2511 Pelaaja pelaaja = (Pelaaja)kohde; 2512 if (pelaaja.DamageResistance == true) 2513 { 2514 pelaaja.HPLaskuri.Value -= 20; 2515 } 2516 else 2517 { 2518 pelaaja.HPLaskuri.Value -= 40; 2519 } 2520 } 2521 } 2522 2523 void SinkoOsui(PhysicsObject ammus, PhysicsObject kohde) 2524 { 2525 if (ammus.IsDestroying) return; 2526 if (kohde.Tag.ToString() != "") 2527 { 2528 Explosion rajahdys = new Explosion(100); 2529 rajahdys.Position = ammus.Position; 2530 rajahdys.ShockwaveReachesObject += delegate(IPhysicsObject p, Vector shokki) { PaineaaltoOsuu(p, shokki, rajahdys, 75.0); }; 2531 Add(rajahdys); 2532 rajahdys.Force = 25; 2533 rajahdys.Speed = 1000; 2534 2535 ammus.Destroy(); // ei voi taata tapahtuuko tämä "heti". Siksi tarvitaan alkuun tarkistus, että onko ammus tuhoutumassa. 2536 if (!(kohde is Pelaaja)) return; 2537 Pelaaja pelaaja = (Pelaaja)kohde; 2538 if (pelaaja.DamageResistance == true) 2539 { 2540 pelaaja.HPLaskuri.Value -= 25; 2541 } 2542 else 2543 { 2544 pelaaja.HPLaskuri.Value -= 50; 2545 } 2546 } 2547 } 2548 2549 void KonepistooliOsui(PhysicsObject ammus, PhysicsObject kohde) 2550 { 2551 if (AmmusVoiOsua(ammus, kohde)) 2552 { 2553 Pelaaja p = (Pelaaja)kohde; 2554 if (p.DamageResistance == true) 2555 { 2556 p.HPLaskuri.Value -= 7; 2557 } 2558 else 2559 { 2560 p.HPLaskuri.Value -= 15; 2561 } 2562 } 2563 } 2564 2565 void ExpFlareOsui(PhysicsObject ammus, PhysicsObject kohde) 2566 { 2567 if (ammus.IsDestroying) return; 2568 if (kohde.Tag.ToString() != "") 2569 { 2570 Explosion rajahdys = new Explosion(75); 2571 rajahdys.Position = ammus.Position; 2572 rajahdys.ShockwaveReachesObject += delegate(IPhysicsObject p, Vector shokki) { FlarePaineaaltoOsuu(p, shokki, rajahdys); }; 2573 Add(rajahdys); 2574 rajahdys.Force = 25; 2575 rajahdys.Speed = 1000; 2576 2577 ammus.Destroy(); // ei voi taata tapahtuuko tämä "heti". Siksi tarvitaan alkuun tarkistus, että onko ammus tuhoutumassa. 2578 if (!(kohde is Pelaaja)) return; 2579 Pelaaja pelaaja = (Pelaaja)kohde; 2580 if (pelaaja.DamageResistance == true) 2581 { 2582 pelaaja.HPLaskuri.Value -= 15; 2583 } 2584 else 2585 { 2586 pelaaja.HPLaskuri.Value -= 30; 2587 } 2588 } 2004 2589 } 2005 2590 … … 2024 2609 } 2025 2610 2611 void LuoUpgrade1(Vector paikka, double leveys, double korkeus, Vector koko, String tagi, Image kuva) 2612 { 2613 PhysicsObject upgrade = new PhysicsObject(koko.X, koko.Y); 2614 upgrade.Position = paikka; 2615 upgrade.Tag = tagi; 2616 upgrade.Image = kuva; 2617 Add(upgrade); 2618 AddCollisionHandler<PhysicsObject, Pelaaja>(upgrade, "pelaaja", keraaUpgrade); 2619 } 2620 2026 2621 void LisaaPowerUpPaikka(Vector paikka, double leveys, double korkeus, List<Vector> powerupvektorit) 2027 2622 { … … 2051 2646 hp.Image = kuva; 2052 2647 Add(hp); 2053 AddCollisionHandler<PhysicsObject, Pelaaja>(hp, "pelaaja", keraaHP); 2648 AddCollisionHandler<PhysicsObject, Pelaaja>(hp, "pelaaja", keraaHP1); 2649 } 2650 2651 void LuoHPIncrease(Vector paikka, double leveys, double korkeus, Vector koko, String tagi, Image kuva) 2652 { 2653 PhysicsObject hpboost = new PhysicsObject(koko.X, koko.Y); 2654 hpboost.Position = paikka; 2655 hpboost.Tag = tagi; 2656 hpboost.Image = kuva; 2657 Add(hpboost); 2658 AddCollisionHandler<PhysicsObject, Pelaaja>(hpboost, "pelaaja", keraaHPBoost); 2054 2659 } 2055 2660 … … 2086 2691 ase.Image = kivaarinkuva; 2087 2692 } 2693 2088 2694 if (aseenTag == "Magnum") 2089 2695 { … … 2416 3022 } 2417 3023 3024 if (aseenTag == "Valopistooli Lv. 2") 3025 { 3026 ase = new AssaultRifle(18, 10); 3027 ase.FireRate = 1; 3028 ase.ProjectileCollision = FlareOsui2; 3029 ase.Power.Value = 300; 3030 ase.Power.DefaultValue = 300; 3031 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(10); 3032 ase.Tag = "Valopistooli Lv. 2"; 3033 ase.Image = flaregunkuva2; 3034 ase.X = 10; 3035 ase.Y = 10; 3036 } 3037 3038 if (aseenTag == "Valopistooli Lv. 3") 3039 { 3040 ase = new AssaultRifle(18, 10); 3041 ase.FireRate = 1.2; 3042 ase.ProjectileCollision = FlareOsui3; 3043 ase.Power.Value = 300; 3044 ase.Power.DefaultValue = 300; 3045 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(10); 3046 ase.Tag = "Valopistooli Lv. 3"; 3047 ase.Image = flaregunkuva3; 3048 ase.X = 10; 3049 ase.Y = 10; 3050 } 3051 3052 if (aseenTag == "Valopistooli Lv. 4") 3053 { 3054 ase = new AssaultRifle(18, 10); 3055 ase.FireRate = 1.5; 3056 ase.ProjectileCollision = FlareOsui4; 3057 ase.Power.Value = 300; 3058 ase.Power.DefaultValue = 300; 3059 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(10); 3060 ase.Tag = "Valopistooli Lv. 4"; 3061 ase.Image = flaregunkuva4; 3062 ase.X = 10; 3063 ase.Y = 10; 3064 } 3065 3066 // Muunnetut aseet 3067 3068 if (aseenTag == "Sarjatulikivääri") 3069 { 3070 ase = new AssaultRifle(39, 13); 3071 ase.FireRate = 4; 3072 ase.ProjectileCollision = SarjatulikivaariOsui; 3073 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(10); 3074 ase.Tag = "Sarjatulikivääri"; 3075 ase.Image = kivaarinkuva; 3076 } 3077 3078 if (aseenTag == "Revolveri") 3079 { 3080 ase = new AssaultRifle(17, 12); 3081 ase.FireRate = 3.0; 3082 ase.ProjectileCollision = RevolveriOsui; 3083 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(10); 3084 ase.Tag = "Revolveri"; 3085 ase.Image = magnumkuva; 3086 3087 // Paikka suhteessa pelaajaan 3088 ase.X = 10; 3089 ase.Y = 10; 3090 } 3091 3092 if (aseenTag == "Katkaistu haulikko") 3093 { 3094 ase = new AssaultRifle(42, 10); 3095 ase.FireRate = 1.5; 3096 ase.ProjectileCollision = KatkaistuHaulikkoOsui; 3097 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(0.4); 3098 ase.Tag = "Katkaistu haulikko"; 3099 ase.Image = haulikonkuva; 3100 } 3101 3102 if (aseenTag == "Panssari-Sniper") 3103 { 3104 ase = new AssaultRifle(42, 11); 3105 ase.FireRate = 0.5; 3106 ase.ProjectileCollision = PanssariSniperOsui; 3107 ase.Power.Value = 400; 3108 ase.Power.DefaultValue = 400; 3109 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(10); 3110 ase.Tag = "Panssari-Sniper"; 3111 ase.Image = sniperinkuva; 3112 } 3113 3114 if (aseenTag == "Sirpalekranaatinheitin") 3115 { 3116 ase = new Cannon(37, 17); 3117 ase.FireRate = 1.0; 3118 ase.ProjectileCollision = delegate(PhysicsObject ammus, PhysicsObject kohde) { SirpaleKranaattiOsui(ammus, kohde); }; 3119 ase.Power.Value = 25000; 3120 ase.Power.DefaultValue = 25000; 3121 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(3); 3122 ase.Tag = "Sirpalekranaatinheitin"; 3123 ase.Image = kranaatinheittimenkuva; 3124 } 3125 3126 if (aseenTag == "Sinko") 3127 { 3128 ase = new AssaultRifle(48, 15); 3129 ase.FireRate = 0.75; 3130 ase.ProjectileCollision = delegate(PhysicsObject ammus, PhysicsObject kohde) { SinkoOsui(ammus, kohde); }; 3131 ase.Power.Value = 165; 3132 ase.Power.DefaultValue = 165; 3133 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(10); 3134 ase.Tag = "Sinko"; 3135 ase.Image = raketinheittimenkuva; 3136 } 3137 3138 if (aseenTag == "Konepistooli") 3139 { 3140 ase = new AssaultRifle(16, 11); 3141 ase.FireRate = 17; 3142 ase.ProjectileCollision = KonepistooliOsui; 3143 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(10); 3144 ase.Tag = "Konepistooli"; 3145 ase.Image = konepistoolinkuva; 3146 ase.X = 10; 3147 ase.Y = 10; 3148 } 3149 if (aseenTag == "Räjähtävä valopistooli") 3150 { 3151 ase = new AssaultRifle(18, 10); 3152 ase.FireRate = 1.0; 3153 ase.ProjectileCollision = ExpFlareOsui; 3154 ase.Power.Value = 300; 3155 ase.Power.DefaultValue = 300; 3156 ase.MaxAmmoLifetime = TimeSpan.FromSeconds(10); 3157 ase.Tag = "Räjähtävä valopistooli"; 3158 ase.Image = flaregunkuva; 3159 ase.X = 10; 3160 ase.Y = 10; 3161 } 3162 2418 3163 if (ase != null) 2419 3164 { … … 2422 3167 } 2423 3168 return false; 3169 } 3170 3171 void MuunnaAse(string aseenTag, Pelaaja pelaaja) 3172 { 3173 if (aseenTag == null) return; 3174 3175 if (aseenTag.Length >= 7 && aseenTag.Substring(0, 7) == "Kivääri") 3176 { 3177 LuoAsePelaajalle("Sarjatulikivääri", pelaaja); 3178 } 3179 if (aseenTag.Length >= 6 && aseenTag.Substring(0, 6) == "Magnum") 3180 { 3181 LuoAsePelaajalle("Revolveri", pelaaja); 3182 } 3183 if (aseenTag.Length >= 8 && aseenTag.Substring(0, 8) == "Haulikko") 3184 { 3185 LuoAsePelaajalle("Katkaistu haulikko", pelaaja); 3186 } 3187 if (aseenTag.Length >= 6 && aseenTag.Substring(0, 6) == "Sniper") 3188 { 3189 LuoAsePelaajalle("Panssari-Sniper", pelaaja); 3190 } 3191 if (aseenTag.Length >= 15 && aseenTag.Substring(0, 15) == "Kranaatinheitin") 3192 { 3193 LuoAsePelaajalle("Sirpalekranaatinheitin", pelaaja); 3194 } 3195 if (aseenTag.Length >= 13 && aseenTag.Substring(0, 13) == "Raketinheitin") 3196 { 3197 LuoAsePelaajalle("Sinko", pelaaja); 3198 } 3199 if (aseenTag.Length >= 8 && aseenTag.Substring(0, 8) == "Pistooli") 3200 { 3201 LuoAsePelaajalle("Konepistooli", pelaaja); 3202 } 3203 3204 // Yksinpeli aseet 3205 if (aseenTag.Length >= 12 && aseenTag.Substring(0, 12) == "Valopistooli") 3206 { 3207 LuoAsePelaajalle("Räjähtävä valopistooli", pelaaja); 3208 } 2424 3209 } 2425 3210 … … 2721 3506 rajahdys.Speed = 1000; 2722 3507 } 3508 3509 // Yksinpeli aseet 3510 if (aseenTag == "Valopistooli") 3511 { 3512 LuoAsePelaajalle("Valopistooli Lv. 2", pelaaja); 3513 } 3514 3515 if (aseenTag == "Valopistooli Lv. 2") 3516 { 3517 LuoAsePelaajalle("Valopistooli Lv. 3", pelaaja); 3518 } 3519 3520 if (aseenTag == "Valopistooli Lv. 3") 3521 { 3522 LuoAsePelaajalle("Valopistooli Lv. 4", pelaaja); 3523 Timer.SingleShot(5.0, delegate 3524 { 3525 if (pelaaja.IsDestroyed == true) 3526 { 3527 return; 3528 } 3529 string aseTag = pelaaja.Weapon.Tag.ToString(); 3530 if (aseTag == "Valopistooli Lv. 4") 3531 { 3532 saaAmpua = false; 3533 Timer.SingleShot(0.1, delegate 3534 { 3535 saaAmpua = true; 3536 }); LuoAsePelaajalle("Valopistooli Lv. 3", pelaaja); naytaTiedot(); 3537 } 3538 else 3539 { 3540 return; 3541 } 3542 }); 3543 } 2723 3544 } 2724 3545 … … 2745 3566 2746 3567 //Admin 2747 Keyboard.Listen(Key.F1, ButtonState.Pressed, Console , null);3568 Keyboard.Listen(Key.F1, ButtonState.Pressed, ConsoleSingle, null); 2748 3569 } 2749 3570 … … 2768 3589 2769 3590 Keyboard.Listen(Key.Escape, ButtonState.Pressed, PeliPauselle, "Pysäyttää pelin", pelaaja1); 3591 3592 //Admin 3593 Keyboard.Listen(Key.F1, ButtonState.Pressed, ConsoleMulti, null); 2770 3594 2771 3595 lisaaGamePadNappaimet(ControllerOne, pelaaja1); … … 2868 3692 } 2869 3693 2870 void Console ()3694 void ConsoleSingle() 2871 3695 { 2872 3696 InputWindow console = new InputWindow("Console"); … … 2875 3699 } 2876 3700 3701 void ConsoleMulti() 3702 { 3703 InputWindow console = new InputWindow("Console"); 3704 console.TextEntered += ProcessInputMulti; 3705 Add(console); 3706 } 3707 2877 3708 void ProcessInput(InputWindow ikkuna) 2878 3709 { … … 3035 3866 } 3036 3867 3037 // kerättävät 3868 // Muunnetut aseet 3869 if (vastaus.Substring(5) == "burstrifle") 3870 { 3871 LuoAsePelaajalle("Sarjatulikivääri", pelaaja1); 3872 } 3873 3874 if (vastaus.Substring(5) == "revolver") 3875 { 3876 LuoAsePelaajalle("Revolveri", pelaaja1); 3877 } 3878 3879 if (vastaus.Substring(5) == "sawedoff") 3880 { 3881 LuoAsePelaajalle("Katkaistu haulikko", pelaaja1); 3882 } 3883 3884 if (vastaus.Substring(5) == "apsniper") 3885 { 3886 LuoAsePelaajalle("Panssari-Sniper", pelaaja1); 3887 } 3888 3889 if (vastaus.Substring(5) == "clustergrenadelauncher") 3890 { 3891 LuoAsePelaajalle("Sirpalekranaatinheitin", pelaaja1); 3892 } 3893 3894 if (vastaus.Substring(5) == "rpg") 3895 { 3896 LuoAsePelaajalle("Sinko", pelaaja1); 3897 } 3898 3899 if (vastaus.Substring(5) == "smg") 3900 { 3901 LuoAsePelaajalle("Konepistooli", pelaaja1); 3902 } 3903 if (vastaus.Substring(5) == "explosiveflaregun") 3904 { 3905 LuoAsePelaajalle("Räjähtävä valopistooli", pelaaja1); 3906 } 3907 3908 // Kerättävät 3038 3909 if (vastaus.Substring(5) == "powerup") 3039 3910 { … … 3041 3912 else { PaivitaAse(pelaaja1.Weapon.Tag.ToString(), pelaaja1); } 3042 3913 } 3914 3915 if (vastaus.Substring(5) == "mod") 3916 { 3917 if (pelaaja1.Weapon == null || pelaaja1.Weapon.Tag == null) { return; } 3918 else { MuunnaAse(pelaaja1.Weapon.Tag.ToString(), pelaaja1); } 3919 } 3920 3043 3921 if (vastaus.Substring(5) == "health") 3044 3922 { 3045 BoostiHP(pelaaja1); 3923 BoostiHP1(pelaaja1); 3924 } 3925 3926 if (vastaus.Substring(5) == "hpboost") 3927 { 3928 IncreaseHP(pelaaja1); 3046 3929 } 3047 3930 … … 3061 3944 { 3062 3945 LuoTaso2(); 3946 } 3947 } 3948 3949 if (vastaus == "nextlevel") 3950 { 3951 SeuraavaTaso(pelaaja1, null); 3952 } 3953 if (vastaus == "restartlevel") 3954 { 3955 uusiYksinPeli(); 3956 } 3957 3958 if (vastaus == "kill") 3959 { 3960 pelaaja1.HPLaskuri.Value = pelaaja1.HPLaskuri.MinValue; 3961 } 3962 3963 if (vastaus == "heal") 3964 { 3965 pelaaja1.HPLaskuri.Value = pelaaja1.HPLaskuri.MaxValue; 3966 } 3967 } 3968 3969 void ProcessInputMulti(InputWindow ikkuna) 3970 { 3971 string vastaus = ikkuna.InputBox.Text; 3972 // tehdään jotain vastauksella 3973 if (vastaus.Length >= 6 && vastaus.Substring(0, 5) == "give ") 3974 { 3975 if (vastaus.Length >= 9 && vastaus.Substring(5, 3) == "p1 ") 3976 { 3977 // aseet 3978 if (vastaus.Substring(8) == "pistol") 3979 { 3980 LuoAsePelaajalle("Pistooli", pelaaja1); 3981 } 3982 if (vastaus.Substring(8) == "pistol2") 3983 { 3984 LuoAsePelaajalle("Pistooli Lv. 2", pelaaja1); 3985 } 3986 if (vastaus.Substring(8) == "pistol3") 3987 { 3988 LuoAsePelaajalle("Pistooli Lv. 3", pelaaja1); 3989 } 3990 if (vastaus.Substring(8) == "pistol4") 3991 { 3992 LuoAsePelaajalle("Pistooli Lv. 4", pelaaja1); 3993 } 3994 3995 if (vastaus.Substring(8) == "assaultrifle") 3996 { 3997 LuoAsePelaajalle("Kivääri", pelaaja1); 3998 } 3999 if (vastaus.Substring(8) == "assaultrifle2") 4000 { 4001 LuoAsePelaajalle("Kivääri Lv. 2", pelaaja1); 4002 } 4003 if (vastaus.Substring(8) == "assaultrifle3") 4004 { 4005 LuoAsePelaajalle("Kivääri Lv. 3", pelaaja1); 4006 } 4007 if (vastaus.Substring(8) == "assaultrifle4") 4008 { 4009 LuoAsePelaajalle("Kivääri Lv. 4", pelaaja1); 4010 } 4011 4012 if (vastaus.Substring(8) == "shotgun") 4013 { 4014 LuoAsePelaajalle("Haulikko", pelaaja1); 4015 } 4016 if (vastaus.Substring(8) == "shotgun2") 4017 { 4018 LuoAsePelaajalle("Haulikko Lv. 2", pelaaja1); 4019 } 4020 if (vastaus.Substring(8) == "shotgun3") 4021 { 4022 LuoAsePelaajalle("Haulikko Lv. 3", pelaaja1); 4023 } 4024 if (vastaus.Substring(8) == "shotgun4") 4025 { 4026 LuoAsePelaajalle("Haulikko Lv. 4", pelaaja1); 4027 } 4028 4029 if (vastaus.Substring(8) == "magnum") 4030 { 4031 LuoAsePelaajalle("Magnum", pelaaja1); 4032 } 4033 if (vastaus.Substring(8) == "magnum2") 4034 { 4035 LuoAsePelaajalle("Magnum Lv. 2", pelaaja1); 4036 } 4037 if (vastaus.Substring(8) == "magnum3") 4038 { 4039 LuoAsePelaajalle("Magnum Lv. 3", pelaaja1); 4040 } 4041 if (vastaus.Substring(8) == "magnum4") 4042 { 4043 LuoAsePelaajalle("Magnum Lv. 4", pelaaja1); 4044 } 4045 4046 if (vastaus.Substring(8) == "sniper") 4047 { 4048 LuoAsePelaajalle("Sniper", pelaaja1); 4049 } 4050 if (vastaus.Substring(8) == "sniper2") 4051 { 4052 LuoAsePelaajalle("Sniper Lv. 2", pelaaja1); 4053 } 4054 if (vastaus.Substring(8) == "sniper3") 4055 { 4056 LuoAsePelaajalle("Sniper Lv. 3", pelaaja1); 4057 } 4058 if (vastaus.Substring(8) == "sniper4") 4059 { 4060 LuoAsePelaajalle("Sniper Lv. 4", pelaaja1); 4061 } 4062 4063 if (vastaus.Substring(8) == "rocketlauncher") 4064 { 4065 LuoAsePelaajalle("Raketinheitin", pelaaja1); 4066 } 4067 if (vastaus.Substring(8) == "rocketlauncher2") 4068 { 4069 LuoAsePelaajalle("Raketinheitin Lv. 2", pelaaja1); 4070 } 4071 if (vastaus.Substring(8) == "rocketlauncher3") 4072 { 4073 LuoAsePelaajalle("Raketinheitin Lv. 3", pelaaja1); 4074 } 4075 if (vastaus.Substring(8) == "rocketlauncher4") 4076 { 4077 LuoAsePelaajalle("Raketinheitin Lv. 4", pelaaja1); 4078 } 4079 4080 if (vastaus.Substring(8) == "grenadelauncher") 4081 { 4082 LuoAsePelaajalle("Kranaatinheitin", pelaaja1); 4083 } 4084 if (vastaus.Substring(8) == "grenadelauncher2") 4085 { 4086 LuoAsePelaajalle("Kranaatinheitin Lv. 2", pelaaja1); 4087 } 4088 if (vastaus.Substring(8) == "grenadelauncher3") 4089 { 4090 LuoAsePelaajalle("Kranaatinheitin Lv. 3", pelaaja1); 4091 } 4092 if (vastaus.Substring(8) == "grenadelauncher4") 4093 { 4094 LuoAsePelaajalle("Kranaatinheitin Lv. 4", pelaaja1); 4095 } 4096 4097 if (vastaus.Substring(8) == "flaregun") 4098 { 4099 LuoAsePelaajalle("Valopistooli", pelaaja1); 4100 } 4101 if (vastaus.Substring(8) == "flaregun2") 4102 { 4103 LuoAsePelaajalle("Valopistooli Lv. 2", pelaaja1); 4104 } 4105 if (vastaus.Substring(8) == "flaregun3") 4106 { 4107 LuoAsePelaajalle("Valopistooli Lv. 3", pelaaja1); 4108 } 4109 if (vastaus.Substring(8) == "flaregun4") 4110 { 4111 LuoAsePelaajalle("Valopistooli Lv. 4", pelaaja1); 4112 } 4113 4114 if (vastaus.Substring(8) == "sword") 4115 { 4116 LuoAsePelaajalle("Miekka", pelaaja1); 4117 } 4118 if (vastaus.Substring(8) == "sword2") 4119 { 4120 LuoAsePelaajalle("Miekka Lv. 2", pelaaja1); 4121 } 4122 if (vastaus.Substring(8) == "sword3") 4123 { 4124 LuoAsePelaajalle("Miekka Lv. 3", pelaaja1); 4125 } 4126 if (vastaus.Substring(8) == "sword4") 4127 { 4128 LuoAsePelaajalle("Miekka Lv. 4", pelaaja1); 4129 } 4130 4131 // Muunnetut aseet 4132 if (vastaus.Substring(8) == "burstrifle") 4133 { 4134 LuoAsePelaajalle("Sarjatulikivääri", pelaaja1); 4135 } 4136 4137 if (vastaus.Substring(8) == "revolver") 4138 { 4139 LuoAsePelaajalle("Revolveri", pelaaja1); 4140 } 4141 4142 if (vastaus.Substring(8) == "sawedoff") 4143 { 4144 LuoAsePelaajalle("Katkaistu haulikko", pelaaja1); 4145 } 4146 4147 if (vastaus.Substring(8) == "apsniper") 4148 { 4149 LuoAsePelaajalle("Panssari-Sniper", pelaaja1); 4150 } 4151 4152 if (vastaus.Substring(8) == "clustergrenadelauncher") 4153 { 4154 LuoAsePelaajalle("Sirpalekranaatinheitin", pelaaja1); 4155 } 4156 4157 if (vastaus.Substring(8) == "rpg") 4158 { 4159 LuoAsePelaajalle("Sinko", pelaaja1); 4160 } 4161 4162 if (vastaus.Substring(8) == "smg") 4163 { 4164 LuoAsePelaajalle("Konepistooli", pelaaja1); 4165 } 4166 if (vastaus.Substring(8) == "explosiveflaregun") 4167 { 4168 LuoAsePelaajalle("Räjähtävä valopistooli", pelaaja1); 4169 } 4170 4171 // kerättävät 4172 if (vastaus.Substring(8) == "powerup") 4173 { 4174 if (pelaaja1.Weapon == null || pelaaja1.Weapon.Tag == null) { return; } 4175 else { PaivitaAse(pelaaja1.Weapon.Tag.ToString(), pelaaja1); } 4176 } 4177 if (vastaus.Substring(8) == "mod") 4178 { 4179 if (pelaaja1.Weapon == null || pelaaja1.Weapon.Tag == null) { return; } 4180 else { MuunnaAse(pelaaja1.Weapon.Tag.ToString(), pelaaja1); } 4181 } 4182 if (vastaus.Substring(8) == "health") 4183 { 4184 BoostiHP(pelaaja1); 4185 } 4186 if (vastaus.Substring(8) == "hpboost") 4187 { 4188 IncreaseHP(pelaaja1); 4189 } 4190 } 4191 4192 if (vastaus.Length >= 9 && vastaus.Substring(5, 3) == "p2 ") 4193 { 4194 // aseet 4195 if (vastaus.Substring(8) == "pistol") 4196 { 4197 LuoAsePelaajalle("Pistooli", pelaaja2); 4198 } 4199 if (vastaus.Substring(8) == "pistol2") 4200 { 4201 LuoAsePelaajalle("Pistooli Lv. 2", pelaaja2); 4202 } 4203 if (vastaus.Substring(8) == "pistol3") 4204 { 4205 LuoAsePelaajalle("Pistooli Lv. 3", pelaaja2); 4206 } 4207 if (vastaus.Substring(8) == "pistol4") 4208 { 4209 LuoAsePelaajalle("Pistooli Lv. 4", pelaaja2); 4210 } 4211 4212 if (vastaus.Substring(8) == "assaultrifle") 4213 { 4214 LuoAsePelaajalle("Kivääri", pelaaja2); 4215 } 4216 if (vastaus.Substring(8) == "assaultrifle2") 4217 { 4218 LuoAsePelaajalle("Kivääri Lv. 2", pelaaja2); 4219 } 4220 if (vastaus.Substring(8) == "assaultrifle3") 4221 { 4222 LuoAsePelaajalle("Kivääri Lv. 3", pelaaja2); 4223 } 4224 if (vastaus.Substring(8) == "assaultrifle4") 4225 { 4226 LuoAsePelaajalle("Kivääri Lv. 4", pelaaja2); 4227 } 4228 4229 if (vastaus.Substring(8) == "shotgun") 4230 { 4231 LuoAsePelaajalle("Haulikko", pelaaja2); 4232 } 4233 if (vastaus.Substring(8) == "shotgun2") 4234 { 4235 LuoAsePelaajalle("Haulikko Lv. 2", pelaaja2); 4236 } 4237 if (vastaus.Substring(8) == "shotgun3") 4238 { 4239 LuoAsePelaajalle("Haulikko Lv. 3", pelaaja2); 4240 } 4241 if (vastaus.Substring(8) == "shotgun4") 4242 { 4243 LuoAsePelaajalle("Haulikko Lv. 4", pelaaja2); 4244 } 4245 4246 if (vastaus.Substring(8) == "magnum") 4247 { 4248 LuoAsePelaajalle("Magnum", pelaaja2); 4249 } 4250 if (vastaus.Substring(8) == "magnum2") 4251 { 4252 LuoAsePelaajalle("Magnum Lv. 2", pelaaja2); 4253 } 4254 if (vastaus.Substring(8) == "magnum3") 4255 { 4256 LuoAsePelaajalle("Magnum Lv. 3", pelaaja2); 4257 } 4258 if (vastaus.Substring(8) == "magnum4") 4259 { 4260 LuoAsePelaajalle("Magnum Lv. 4", pelaaja2); 4261 } 4262 4263 if (vastaus.Substring(8) == "sniper") 4264 { 4265 LuoAsePelaajalle("Sniper", pelaaja2); 4266 } 4267 if (vastaus.Substring(8) == "sniper2") 4268 { 4269 LuoAsePelaajalle("Sniper Lv. 2", pelaaja2); 4270 } 4271 if (vastaus.Substring(8) == "sniper3") 4272 { 4273 LuoAsePelaajalle("Sniper Lv. 3", pelaaja2); 4274 } 4275 if (vastaus.Substring(8) == "sniper4") 4276 { 4277 LuoAsePelaajalle("Sniper Lv. 4", pelaaja2); 4278 } 4279 4280 if (vastaus.Substring(8) == "rocketlauncher") 4281 { 4282 LuoAsePelaajalle("Raketinheitin", pelaaja2); 4283 } 4284 if (vastaus.Substring(8) == "rocketlauncher2") 4285 { 4286 LuoAsePelaajalle("Raketinheitin Lv. 2", pelaaja2); 4287 } 4288 if (vastaus.Substring(8) == "rocketlauncher3") 4289 { 4290 LuoAsePelaajalle("Raketinheitin Lv. 3", pelaaja2); 4291 } 4292 if (vastaus.Substring(8) == "rocketlauncher4") 4293 { 4294 LuoAsePelaajalle("Raketinheitin Lv. 4", pelaaja2); 4295 } 4296 4297 if (vastaus.Substring(8) == "grenadelauncher") 4298 { 4299 LuoAsePelaajalle("Kranaatinheitin", pelaaja2); 4300 } 4301 if (vastaus.Substring(8) == "grenadelauncher2") 4302 { 4303 LuoAsePelaajalle("Kranaatinheitin Lv. 2", pelaaja2); 4304 } 4305 if (vastaus.Substring(8) == "grenadelauncher3") 4306 { 4307 LuoAsePelaajalle("Kranaatinheitin Lv. 3", pelaaja2); 4308 } 4309 if (vastaus.Substring(8) == "grenadelauncher4") 4310 { 4311 LuoAsePelaajalle("Kranaatinheitin Lv. 4", pelaaja2); 4312 } 4313 4314 if (vastaus.Substring(8) == "flaregun") 4315 { 4316 LuoAsePelaajalle("Valopistooli", pelaaja2); 4317 } 4318 if (vastaus.Substring(8) == "flaregun2") 4319 { 4320 LuoAsePelaajalle("Valopistooli Lv. 2", pelaaja2); 4321 } 4322 if (vastaus.Substring(8) == "flaregun3") 4323 { 4324 LuoAsePelaajalle("Valopistooli Lv. 3", pelaaja2); 4325 } 4326 if (vastaus.Substring(8) == "flaregun4") 4327 { 4328 LuoAsePelaajalle("Valopistooli Lv. 4", pelaaja2); 4329 } 4330 4331 if (vastaus.Substring(8) == "sword") 4332 { 4333 LuoAsePelaajalle("Miekka", pelaaja2); 4334 } 4335 if (vastaus.Substring(8) == "sword2") 4336 { 4337 LuoAsePelaajalle("Miekka Lv. 2", pelaaja2); 4338 } 4339 if (vastaus.Substring(8) == "sword3") 4340 { 4341 LuoAsePelaajalle("Miekka Lv. 3", pelaaja2); 4342 } 4343 if (vastaus.Substring(8) == "sword4") 4344 { 4345 LuoAsePelaajalle("Miekka Lv. 4", pelaaja2); 4346 } 4347 4348 // Muunnetut aseet 4349 if (vastaus.Substring(8) == "burstrifle") 4350 { 4351 LuoAsePelaajalle("Sarjatulikivääri", pelaaja2); 4352 } 4353 4354 if (vastaus.Substring(8) == "revolver") 4355 { 4356 LuoAsePelaajalle("Revolveri", pelaaja2); 4357 } 4358 4359 if (vastaus.Substring(8) == "sawedoff") 4360 { 4361 LuoAsePelaajalle("Katkaistu haulikko", pelaaja2); 4362 } 4363 4364 if (vastaus.Substring(8) == "apsniper") 4365 { 4366 LuoAsePelaajalle("Panssari-Sniper", pelaaja2); 4367 } 4368 4369 if (vastaus.Substring(8) == "clustergrenadelauncher") 4370 { 4371 LuoAsePelaajalle("Sirpalekranaatinheitin", pelaaja2); 4372 } 4373 4374 if (vastaus.Substring(8) == "rpg") 4375 { 4376 LuoAsePelaajalle("Sinko", pelaaja2); 4377 } 4378 4379 if (vastaus.Substring(8) == "smg") 4380 { 4381 LuoAsePelaajalle("Konepistooli", pelaaja2); 4382 } 4383 if (vastaus.Substring(8) == "explosiveflaregun") 4384 { 4385 LuoAsePelaajalle("Räjähtävä valopistooli", pelaaja2); 4386 } 4387 4388 // kerättävät 4389 if (vastaus.Substring(8) == "powerup") 4390 { 4391 if (pelaaja2.Weapon == null || pelaaja2.Weapon.Tag == null) { return; } 4392 else { PaivitaAse(pelaaja2.Weapon.Tag.ToString(), pelaaja2); } 4393 } 4394 if (vastaus.Substring(8) == "mod") 4395 { 4396 if (pelaaja2.Weapon == null || pelaaja2.Weapon.Tag == null) { return; } 4397 else { MuunnaAse(pelaaja2.Weapon.Tag.ToString(), pelaaja2); } 4398 } 4399 if (vastaus.Substring(8) == "health") 4400 { 4401 BoostiHP(pelaaja2); 4402 } 4403 if (vastaus.Substring(8) == "hpboost") 4404 { 4405 IncreaseHP(pelaaja2); 4406 } 4407 } 4408 4409 } 4410 4411 if (vastaus.Length >= 7 && vastaus.Substring(0, 6) == "level ") 4412 { 4413 if (vastaus.Substring(6) == "0") 4414 { 4415 LuoKentta0(); 4416 } 4417 if (vastaus.Substring(6) == "1") 4418 { 4419 LuoKentta1(); 4420 } 4421 if (vastaus.Substring(6) == "2") 4422 { 4423 LuoKentta2(); 4424 } 4425 if (vastaus.Substring(6) == "3") 4426 { 4427 LuoKentta3(); 4428 } 4429 } 4430 if (vastaus.Length >= 6 && vastaus.Substring(0, 5) == "kill ") 4431 { 4432 if (vastaus.Length >= 7 && vastaus.Substring(5, 2) == "p1") 4433 { 4434 pelaaja1.HPLaskuri.Value = pelaaja1.HPLaskuri.MinValue; 4435 } 4436 if (vastaus.Length >= 7 && vastaus.Substring(5, 2) == "p2") 4437 { 4438 pelaaja2.HPLaskuri.Value = pelaaja2.HPLaskuri.MinValue; 4439 } 4440 } 4441 4442 if (vastaus.Length >= 6 && vastaus.Substring(0, 5) == "heal ") 4443 { 4444 if (vastaus.Length >= 7 && vastaus.Substring(5, 2) == "p1") 4445 { 4446 pelaaja1.HPLaskuri.Value = pelaaja1.HPLaskuri.MaxValue; 4447 } 4448 4449 if (vastaus.Length >= 7 && vastaus.Substring(5, 2) == "p2") 4450 { 4451 pelaaja2.HPLaskuri.Value = pelaaja2.HPLaskuri.MaxValue; 3063 4452 } 3064 4453 } … … 3360 4749 Timer.SingleShot(0.05, delegate { Add(ammus2); }); 3361 4750 } 4751 3362 4752 if ((string)hahmo.Weapon.Tag == "Valopistooli") 3363 4753 { … … 3368 4758 ammus.IgnoresCollisionResponse = false; 3369 4759 Timer.SingleShot(0.1, delegate { ammus.CollisionIgnorer = null; }); 4760 AddCollisionHandler(ammus, "poltettava taso", delegate(PhysicsObject o, PhysicsObject k) { PoltaTaso(k); }); 4761 } 4762 if ((string)hahmo.Weapon.Tag == "Valopistooli Lv. 2") 4763 { 4764 ammus.Image = flarekuva2; 4765 ammus.Size += new Vector(3, 1); 4766 ammus.IgnoresGravity = false; 4767 ammus.Hit(new Vector(0, 20)); 4768 ammus.IgnoresCollisionResponse = false; 4769 Timer.SingleShot(0.1, delegate { ammus.CollisionIgnorer = null; }); 4770 } 4771 if ((string)hahmo.Weapon.Tag == "Valopistooli Lv. 3") 4772 { 4773 ammus.Image = flarekuva3; 4774 ammus.Size += new Vector(3, 1); 4775 ammus.IgnoresGravity = false; 4776 ammus.Hit(new Vector(0, 20)); 4777 ammus.IgnoresCollisionResponse = false; 4778 Timer.SingleShot(0.1, delegate { ammus.CollisionIgnorer = null; }); 4779 } 4780 if ((string)hahmo.Weapon.Tag == "Valopistooli Lv. 4") 4781 { 4782 ammus.Image = flarekuva4; 4783 ammus.Size += new Vector(3, 1); 4784 ammus.IgnoresGravity = false; 4785 ammus.Hit(new Vector(0, 20)); 4786 ammus.IgnoresCollisionResponse = false; 4787 Timer.SingleShot(0.1, delegate { ammus.CollisionIgnorer = null; }); 4788 } 4789 4790 // Muunnetut aseet 4791 4792 if ((string)hahmo.Weapon.Tag == "Sarjatulikivääri") 4793 { 4794 PhysicsObject ammus2 = new PhysicsObject(ammus.Image); 4795 ammus2.Angle = hahmo.FacingDirection.Angle; 4796 ammus2.IgnoresGravity = true; 4797 ammus2.Size = ammus.Size; 4798 ammus2.Position = ammus.Position; 4799 ammus2.Velocity = ammus.Velocity; 4800 ammus2.MaximumLifetime = ammus.MaximumLifetime; 4801 ammus2.CollisionIgnorer = ammus.CollisionIgnorer; 4802 ammus2.Tag = "ammus"; 4803 ammus2.IgnoresCollisionResponse = true; 4804 ammus2.IgnoresExplosions = true; 4805 AddCollisionHandler(ammus2, SarjatulikivaariOsui); 4806 4807 PhysicsObject ammus3 = new PhysicsObject(ammus.Image); 4808 ammus3.Angle = hahmo.FacingDirection.Angle; 4809 ammus3.IgnoresGravity = true; 4810 ammus3.Size = ammus.Size; 4811 ammus3.Position = ammus.Position; 4812 ammus3.Velocity = ammus.Velocity; 4813 ammus3.MaximumLifetime = ammus.MaximumLifetime; 4814 ammus3.CollisionIgnorer = ammus.CollisionIgnorer; 4815 ammus3.Tag = "ammus"; 4816 ammus3.IgnoresCollisionResponse = true; 4817 ammus3.IgnoresExplosions = true; 4818 AddCollisionHandler(ammus3, SarjatulikivaariOsui); 4819 4820 Timer.SingleShot(0.03, delegate { Add(ammus2); Timer.SingleShot(0.03, delegate { Add(ammus3); }); }); 4821 } 4822 4823 if ((string)hahmo.Weapon.Tag == "Revolveri") 4824 { 4825 ammus.Hit(new Vector(0, RandomGen.NextDouble(-5, 5))); 4826 } 4827 4828 if ((string)hahmo.Weapon.Tag == "Katkaistu haulikko") 4829 { 4830 for (int i = 0; i < 7; i++) 4831 { 4832 PhysicsObject ammus2 = new PhysicsObject(ammus.Image); 4833 ammus2.Angle = hahmo.FacingDirection.Angle; 4834 ammus2.IgnoresGravity = true; 4835 ammus2.Size = ammus.Size; 4836 ammus2.Position = ammus.Position; 4837 ammus2.Velocity = ammus.Velocity; 4838 ammus2.MaximumLifetime = TimeSpan.FromSeconds(0.4); 4839 ammus2.Hit(new Vector(RandomGen.NextDouble(-100, 100), RandomGen.NextDouble(-300, 300))); 4840 ammus2.CollisionIgnorer = ammus.CollisionIgnorer; 4841 ammus2.Tag = "ammus"; 4842 ammus2.IgnoresCollisionResponse = true; 4843 ammus2.IgnoresExplosions = true; 4844 AddCollisionHandler(ammus2, KatkaistuHaulikkoOsui); 4845 Add(ammus2); 4846 } 4847 } 4848 4849 if ((string)hahmo.Weapon.Tag == "Sirpalekranaatinheitin") 4850 { 4851 ammus.Shape = Shape.Circle; 4852 ammus.Image = kranaatinkuva; 4853 ammus.Restitution = 1; 4854 ammus.Mass = 0.2; 4855 ammus.KineticFriction = 0.2; 4856 ammus.StaticFriction = 0.2; 4857 ammus.Position = hahmo.Position; 4858 ammus.Size += new Vector(1, 1); 4859 ammus.IgnoresCollisionResponse = false; 4860 Timer.SingleShot(0.2, delegate { ammus.CollisionIgnorer = null; }); 4861 ammus.Hit(new Vector(0, 40)); 4862 } 4863 4864 if ((string)hahmo.Weapon.Tag == "Sinko") 4865 { 4866 ammus.Image = raketinkuva; 4867 ammus.Size += new Vector(3, 1); 4868 ammus.IgnoresCollisionResponse = false; 4869 Timer.SingleShot(0.1, delegate { ammus.CollisionIgnorer = null; }); 4870 } 4871 4872 if ((string)hahmo.Weapon.Tag == "Konepistooli") 4873 { 4874 ammus.Hit(new Vector(0, RandomGen.NextDouble(-30, 30))); 4875 } 4876 4877 if ((string)hahmo.Weapon.Tag == "Räjähtävä valopistooli") 4878 { 4879 ammus.Image = flarekuva; 4880 ammus.Size += new Vector(3, 1); 4881 ammus.IgnoresGravity = false; 4882 ammus.Hit(new Vector(0, 20)); 4883 ammus.IgnoresCollisionResponse = false; 4884 Timer.SingleShot(0.1, delegate { ammus.CollisionIgnorer = null; }); 3370 4885 } 3371 4886 … … 3381 4896 void uusiYksinPeli() 3382 4897 { 4898 if (sailytahp == true) 4899 { 4900 MAXHP = pelaaja1.HPLaskuri.MaxValue; 4901 CURRENTHP = pelaaja1.HPLaskuri.Value; 4902 sailytahp = false; 4903 } 4904 else 4905 { 4906 CURRENTHP = MAXHP; 4907 } 4908 3383 4909 LuoTasoKentta(); 3384 4910 NollaaLaskurit(); 3385 pelaaja1.Weapon = null;4911 //pelaaja1.Weapon = null; 3386 4912 pelaaja2.Weapon = null; 4913 //pelaaja1.varaAse = null; 4914 pelaaja2.varaAse = null; 3387 4915 lisaaYksinNappaimet(); 3388 PHPMAARA = 100;3389 HPBOOST = 25;3390 4916 LisaaHPNaytto(); 3391 3392 4917 3393 4918 saaAmpua = false; -
2012/09-22/SanteriH/Kynari/Kynari/Kynari/Kynari.csproj.Debug.cachefile
r4418 r4757 57 57 Content\flaregun.xnb 58 58 Content\flare.xnb 59 Content\flaregun2.xnb 60 Content\flaregun3.xnb 61 Content\flaregun4.xnb 62 Content\flare2.xnb 63 Content\flare3.xnb 64 Content\flare4.xnb 65 Content\kentta0.xnb 66 Content\taso2.xnb 67 Content\taso.xnb 68 Content\boost.xnb 69 Content\sidegrade.xnb 70 Content\smg.xnb 59 71 Content\tausta.wma 60 72 Content\kentta1.txt -
2012/09-22/SanteriH/Kynari/Kynari/Kynari/obj/x86/Debug/ContentPipeline-{CE1DC0B1-C320-4A5D-86A8-6245AF0207D1}.xml
r4418 r4757 496 496 <Options>None</Options> 497 497 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\taso1.xnb</Output> 498 <Time>2013-0 7-03T22:03:46.103504+03:00</Time>498 <Time>2013-09-14T11:39:08.3891767+03:00</Time> 499 499 </Item> 500 500 <Item> … … 505 505 <Options>None</Options> 506 506 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\taso0.xnb</Output> 507 <Time>2013-0 6-28T23:20:37.9034089+03:00</Time>507 <Time>2013-07-19T03:15:46.5970099+03:00</Time> 508 508 </Item> 509 509 <Item> … … 524 524 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flare.xnb</Output> 525 525 <Time>2013-07-03T20:17:53.4531532+03:00</Time> 526 </Item> 527 <Item> 528 <Source>flaregun2.png</Source> 529 <Name>flaregun2</Name> 530 <Importer>TextureImporter</Importer> 531 <Processor>TextureProcessor</Processor> 532 <Options>None</Options> 533 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flaregun2.xnb</Output> 534 <Time>2013-07-04T17:42:26.9726184+03:00</Time> 535 </Item> 536 <Item> 537 <Source>flaregun3.png</Source> 538 <Name>flaregun3</Name> 539 <Importer>TextureImporter</Importer> 540 <Processor>TextureProcessor</Processor> 541 <Options>None</Options> 542 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flaregun3.xnb</Output> 543 <Time>2013-07-04T17:44:28.2925575+03:00</Time> 544 </Item> 545 <Item> 546 <Source>flaregun4.png</Source> 547 <Name>flaregun4</Name> 548 <Importer>TextureImporter</Importer> 549 <Processor>TextureProcessor</Processor> 550 <Options>None</Options> 551 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flaregun4.xnb</Output> 552 <Time>2013-07-04T17:49:32.0339305+03:00</Time> 553 </Item> 554 <Item> 555 <Source>flare2.png</Source> 556 <Name>flare2</Name> 557 <Importer>TextureImporter</Importer> 558 <Processor>TextureProcessor</Processor> 559 <Options>None</Options> 560 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flare2.xnb</Output> 561 <Time>2013-07-04T17:52:22.2626671+03:00</Time> 562 </Item> 563 <Item> 564 <Source>flare3.png</Source> 565 <Name>flare3</Name> 566 <Importer>TextureImporter</Importer> 567 <Processor>TextureProcessor</Processor> 568 <Options>None</Options> 569 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flare3.xnb</Output> 570 <Time>2013-07-04T17:53:20.9480237+03:00</Time> 571 </Item> 572 <Item> 573 <Source>flare4.png</Source> 574 <Name>flare4</Name> 575 <Importer>TextureImporter</Importer> 576 <Processor>TextureProcessor</Processor> 577 <Options>None</Options> 578 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flare4.xnb</Output> 579 <Time>2013-07-04T17:55:10.2012726+03:00</Time> 580 </Item> 581 <Item> 582 <Source>kentta0.txt</Source> 583 <Name>kentta0</Name> 584 <Importer>TextFileImporter</Importer> 585 <Processor>TextFileContentProcessor</Processor> 586 <Options>None</Options> 587 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\kentta0.xnb</Output> 588 <Time>2013-07-04T18:20:18.0855186+03:00</Time> 589 </Item> 590 <Item> 591 <Source>taso2.txt</Source> 592 <Name>taso2</Name> 593 <Importer>TextFileImporter</Importer> 594 <Processor>TextFileContentProcessor</Processor> 595 <Options>None</Options> 596 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\taso2.xnb</Output> 597 <Time>2013-09-14T11:38:50.2401386+03:00</Time> 598 </Item> 599 <Item> 600 <Source>taso.txt</Source> 601 <Name>taso</Name> 602 <Importer>TextFileImporter</Importer> 603 <Processor>TextFileContentProcessor</Processor> 604 <Options>None</Options> 605 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\taso.xnb</Output> 606 <Time>2013-07-05T01:20:20.9907977+03:00</Time> 607 </Item> 608 <Item> 609 <Source>boost.png</Source> 610 <Name>boost</Name> 611 <Importer>TextureImporter</Importer> 612 <Processor>TextureProcessor</Processor> 613 <Options>None</Options> 614 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\boost.xnb</Output> 615 <Time>2013-07-19T01:29:41.8039646+03:00</Time> 616 </Item> 617 <Item> 618 <Source>sidegrade.png</Source> 619 <Name>sidegrade</Name> 620 <Importer>TextureImporter</Importer> 621 <Processor>TextureProcessor</Processor> 622 <Options>None</Options> 623 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\sidegrade.xnb</Output> 624 <Time>2013-07-19T01:31:39.1876786+03:00</Time> 625 </Item> 626 <Item> 627 <Source>smg.png</Source> 628 <Name>smg</Name> 629 <Importer>TextureImporter</Importer> 630 <Processor>TextureProcessor</Processor> 631 <Options>None</Options> 632 <Output>D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\smg.xnb</Output> 633 <Time>2013-06-28T15:47:05.6649579+03:00</Time> 526 634 </Item> 527 635 <BuildSuccessful>true</BuildSuccessful> -
2012/09-22/SanteriH/Kynari/Kynari/Kynari/obj/x86/Debug/Kynari.csproj.FileListAbsolute.txt
r4418 r4757 133 133 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flaregun.xnb 134 134 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flare.xnb 135 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flaregun2.xnb 136 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flaregun3.xnb 137 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flaregun4.xnb 138 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flare2.xnb 139 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flare3.xnb 140 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\flare4.xnb 141 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\kentta0.xnb 142 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\taso2.xnb 143 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\taso.xnb 144 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\boost.xnb 145 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\sidegrade.xnb 146 D:\MyTemp\Kynari\Kynari\Kynari\bin\x86\Debug\Content\smg.xnb -
2012/09-22/SanteriH/Kynari/Kynari/Kynari/obj/x86/Debug/cachefile-{CE1DC0B1-C320-4A5D-86A8-6245AF0207D1}-targetpath.txt
r4418 r4757 58 58 Content\flaregun.xnb 59 59 Content\flare.xnb 60 Content\flaregun2.xnb 61 Content\flaregun3.xnb 62 Content\flaregun4.xnb 63 Content\flare2.xnb 64 Content\flare3.xnb 65 Content\flare4.xnb 66 Content\kentta0.xnb 67 Content\taso2.xnb 68 Content\taso.xnb 69 Content\boost.xnb 70 Content\sidegrade.xnb 71 Content\smg.xnb 60 72 Content\kentta1.txt -
2012/09-22/SanteriH/Kynari/Kynari/KynariContent/KynariContent.contentproj
r4418 r4757 435 435 </Compile> 436 436 </ItemGroup> 437 <ItemGroup> 438 <Compile Include="flaregun2.png"> 439 <Name>flaregun2</Name> 440 <Importer>TextureImporter</Importer> 441 <Processor>TextureProcessor</Processor> 442 </Compile> 443 </ItemGroup> 444 <ItemGroup> 445 <Compile Include="flaregun3.png"> 446 <Name>flaregun3</Name> 447 <Importer>TextureImporter</Importer> 448 <Processor>TextureProcessor</Processor> 449 </Compile> 450 </ItemGroup> 451 <ItemGroup> 452 <Compile Include="flaregun4.png"> 453 <Name>flaregun4</Name> 454 <Importer>TextureImporter</Importer> 455 <Processor>TextureProcessor</Processor> 456 </Compile> 457 </ItemGroup> 458 <ItemGroup> 459 <Compile Include="flare2.png"> 460 <Name>flare2</Name> 461 <Importer>TextureImporter</Importer> 462 <Processor>TextureProcessor</Processor> 463 </Compile> 464 <Compile Include="flare3.png"> 465 <Name>flare3</Name> 466 <Importer>TextureImporter</Importer> 467 <Processor>TextureProcessor</Processor> 468 </Compile> 469 <Compile Include="flare4.png"> 470 <Name>flare4</Name> 471 <Importer>TextureImporter</Importer> 472 <Processor>TextureProcessor</Processor> 473 </Compile> 474 </ItemGroup> 475 <ItemGroup> 476 <Compile Include="kentta0.txt"> 477 <Name>kentta0</Name> 478 <Importer>TextFileImporter</Importer> 479 <Processor>TextFileContentProcessor</Processor> 480 </Compile> 481 </ItemGroup> 482 <ItemGroup> 483 <Compile Include="taso2.txt"> 484 <Name>taso2</Name> 485 <Importer>TextFileImporter</Importer> 486 <Processor>TextFileContentProcessor</Processor> 487 </Compile> 488 </ItemGroup> 489 <ItemGroup> 490 <Compile Include="taso.txt"> 491 <Name>taso</Name> 492 <Importer>TextFileImporter</Importer> 493 <Processor>TextFileContentProcessor</Processor> 494 </Compile> 495 </ItemGroup> 496 <ItemGroup> 497 <Compile Include="boost.png"> 498 <Name>boost</Name> 499 <Importer>TextureImporter</Importer> 500 <Processor>TextureProcessor</Processor> 501 </Compile> 502 </ItemGroup> 503 <ItemGroup> 504 <Compile Include="sidegrade.png"> 505 <Name>sidegrade</Name> 506 <Importer>TextureImporter</Importer> 507 <Processor>TextureProcessor</Processor> 508 </Compile> 509 </ItemGroup> 510 <ItemGroup> 511 <Compile Include="smg.png"> 512 <Name>smg</Name> 513 <Importer>TextureImporter</Importer> 514 <Processor>TextureProcessor</Processor> 515 </Compile> 516 </ItemGroup> 437 517 <Import Project="$(MSBuildExtensionsPath)\Microsoft\XNA Game Studio\$(XnaFrameworkVersion)\Microsoft.Xna.GameStudio.ContentPipeline.targets" /> 438 518 <!-- To modify your build process, add your task inside one of the targets below and uncomment it. -
2012/09-22/SanteriH/Kynari/Kynari/KynariContent/taso0.txt
r4418 r4757 11 11 ttttttttttttttttttttt t t . t t t 12 12 t t t . t ttttttttttttttttt 13 t t t tttttttttttttttttttttttttttttt 14 t 1 t t p t t f 13 t t t tttttttttttttttttttttttttttttt , wt 14 t 1 t t p t t f # #t 15 15 z#########################################################tttttttttttttttttttttttttttttttttttt -
2012/09-22/SanteriH/Kynari/Kynari/KynariContent/taso1.txt
r4418 r4757 1 ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt 2 t t . wt3 t t h . #t4 t ttttttt ttttttttttt 5 t t t 6 t t tttt t 7 t t t 8 t t t 9 t t v t 10 t v tttttttttt t 11 t P h ttttttttttttt h ht12 t t ttt tt tt ttt t tttt13 t 1 tt v ttttt tt tt ttttt t v ttttt t 14 ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt 1 tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt 2 t t , . t 3 t t h # . h t 4 t ttttttt ttttttttttt t 5 t t t t 6 t t tttt t t 7 t t t tttttttttttttttt 8 t t t tw t 9 t t v t t# t 10 t v tttttttttt t ttttttttttt t 11 t h ttttttttttttt h h t tt 12 t Pt ttt tt tt ttt t ttt t ttt 13 t 1 tt v ttttt tt tt ttttt t v ttttt t i tttt 14 ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt
Note: See TracChangeset
for help on using the changeset viewer.