Changeset 4760 for 2012/09-22/SanteriH/Kynari/Kynari/Kynari/Kynari.cs
- Timestamp:
- 2013-09-26 13:58:28 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2012/09-22/SanteriH/Kynari/Kynari/Kynari/Kynari.cs
r4759 r4760 10 10 { 11 11 public bool DamageResistance { get; set; } 12 public bool DamageVulnerability { get; set; } 12 13 public bool voikoPoimiaAseen { get; set; } 13 14 public string varaAse; … … 20 21 voikoPoimiaAseen = true; 21 22 DamageResistance = false; 23 DamageVulnerability = false; 22 24 varaAse = null; 23 25 } … … 1280 1282 GameObject kilpi = new GameObject(60, 60, Shape.Circle); 1281 1283 kilpi.Color = new Color(Color.Blue, 50); 1284 //if (pelaaja.DamageVulnerability) { pelaaja.Clear(); } 1282 1285 pelaaja.Add(kilpi); 1283 1286 pelaaja.DamageResistance = true; … … 1653 1656 pelaaja.HPLaskuri.Value -= 12; 1654 1657 } 1658 else if (pelaaja.DamageVulnerability == true) 1659 { 1660 pelaaja.HPLaskuri.Value -= 37; 1661 } 1655 1662 else 1656 1663 { … … 1670 1677 pelaaja.HPLaskuri.Value -= 17; 1671 1678 } 1679 else if (pelaaja.DamageVulnerability == true) 1680 { 1681 pelaaja.HPLaskuri.Value -= 52; 1682 } 1672 1683 else 1673 1684 { … … 1686 1697 { 1687 1698 pelaaja.HPLaskuri.Value -= 10; 1699 } 1700 else if (pelaaja.DamageVulnerability == true) 1701 { 1702 pelaaja.HPLaskuri.Value -= 30; 1688 1703 } 1689 1704 else … … 1746 1761 pelaaja.HPLaskuri.Value -= 10; 1747 1762 } 1763 else if (pelaaja.DamageVulnerability == true) 1764 { 1765 pelaaja.HPLaskuri.Value -= 30; 1766 } 1748 1767 else 1749 1768 { … … 1771 1790 pelaaja.HPLaskuri.Value -= 17; 1772 1791 } 1792 else if (pelaaja.DamageVulnerability == true) 1793 { 1794 pelaaja.HPLaskuri.Value -= 52; 1795 } 1773 1796 else 1774 1797 { … … 1796 1819 pelaaja.HPLaskuri.Value -= 7; 1797 1820 } 1821 else if (pelaaja.DamageVulnerability == true) 1822 { 1823 pelaaja.HPLaskuri.Value -= 22; 1824 } 1798 1825 else 1799 1826 { … … 1813 1840 p.HPLaskuri.Value -= damagenMaara / 2; 1814 1841 } 1842 else if (p.DamageVulnerability == true) 1843 { 1844 p.HPLaskuri.Value -= damagenMaara * 1.5; 1845 } 1815 1846 else 1816 1847 { … … 1825 1856 if (p.ViimeisinRajahdys == e) return; 1826 1857 p.ViimeisinRajahdys = e; 1827 if (p.DamageResistance == true) 1828 { 1858 1829 1859 GameObject liekki = new GameObject(40, 40); 1830 1860 liekki.Color = new Color(Color.Orange, 100); … … 1834 1864 Timer.SingleShot(2.5, delegate { p.Remove(liekki); }); 1835 1865 1836 p.HPLaskuri.Value -= 5;1866 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 1837 1867 Timer.SingleShot(0.5, delegate 1838 1868 { 1839 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; }1869 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 1840 1870 Timer.SingleShot(0.5, delegate 1841 1871 { 1842 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; }1872 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 1843 1873 Timer.SingleShot(0.5, delegate 1844 1874 { 1845 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; }1875 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 1846 1876 Timer.SingleShot(0.5, delegate 1847 1877 { 1848 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; }1878 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 1849 1879 Timer.SingleShot(0.5, delegate 1850 1880 { 1851 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; }1881 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 1852 1882 }); 1853 1883 }); … … 1855 1885 }); 1856 1886 }); 1857 } 1858 else 1859 { 1860 GameObject liekki = new GameObject(40, 40); 1861 liekki.Color = new Color(Color.Orange, 100); 1862 liekki.Shape = Shape.FromImage(norsu); 1863 1864 p.Add(liekki); 1865 Timer.SingleShot(2.5, delegate { p.Remove(liekki); }); 1866 1867 p.HPLaskuri.Value -= 10; 1868 Timer.SingleShot(0.5, delegate 1869 { 1870 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1871 Timer.SingleShot(0.5, delegate 1872 { 1873 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1874 Timer.SingleShot(0.5, delegate 1875 { 1876 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1877 Timer.SingleShot(0.5, delegate 1878 { 1879 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1880 Timer.SingleShot(0.5, delegate 1881 { 1882 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 1883 }); 1884 }); 1885 }); 1886 }); 1887 }); 1888 } 1887 1889 1888 } 1890 1889 … … 1895 1894 if (p.ViimeisinRajahdys == e) return; 1896 1895 p.ViimeisinRajahdys = e; 1897 if (p.DamageResistance == true) 1898 { 1896 1899 1897 GameObject liekki = new GameObject(40, 40); 1900 1898 liekki.Color = new Color(Color.Blue, 100); … … 1904 1902 Timer.SingleShot(3.0, delegate { p.Remove(liekki); }); 1905 1903 1906 p.HPLaskuri.Value -= 15;1904 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 15; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 45; } else { p.HPLaskuri.Value -= 30; } 1907 1905 Timer.SingleShot(0.5, delegate 1908 1906 { 1909 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }1907 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 1910 1908 Timer.SingleShot(0.5, delegate 1911 1909 { 1912 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }1910 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 1913 1911 Timer.SingleShot(0.5, delegate 1914 1912 { 1915 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }1913 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 1916 1914 Timer.SingleShot(0.5, delegate 1917 1915 { 1918 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }1916 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 1919 1917 Timer.SingleShot(0.5, delegate 1920 1918 { 1921 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }1919 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 1922 1920 Timer.SingleShot(0.5, delegate 1923 1921 { 1924 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }1922 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 1925 1923 }); 1926 1924 }); … … 1929 1927 }); 1930 1928 }); 1929 1930 } 1931 1932 bool AmmusVoiOsua(PhysicsObject ammus, PhysicsObject kohde) 1933 { 1934 if (ammus.IsDestroying) return false; 1935 if (kohde.Tag.ToString() != "ammus" && kohde.Tag.ToString() != "") ammus.Destroy(); 1936 if (kohde is Pelaaja) 1937 { 1938 return true; 1931 1939 } 1932 1940 else 1933 1941 { 1934 GameObject liekki = new GameObject(40, 40); 1935 liekki.Color = new Color(Color.Blue, 100); 1936 liekki.Shape = Shape.FromImage(norsu); 1937 1938 p.Add(liekki); 1939 Timer.SingleShot(3.0, delegate { p.Remove(liekki); }); 1940 1941 p.HPLaskuri.Value -= 30; 1942 Timer.SingleShot(0.5, delegate 1943 { 1944 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 1942 return false; 1943 } 1944 } 1945 1946 void PistooliOsui(PhysicsObject ammus, PhysicsObject kohde) 1947 { 1948 if (AmmusVoiOsua(ammus, kohde)) 1949 { 1950 Pelaaja p = (Pelaaja)kohde; 1951 if (p.DamageResistance == true) 1952 { 1953 p.HPLaskuri.Value -= 7; 1954 } 1955 else if (p.DamageVulnerability == true) 1956 { 1957 p.HPLaskuri.Value -= 22; 1958 } 1959 else 1960 { 1961 p.HPLaskuri.Value -= 15; 1962 } 1963 } 1964 } 1965 void PistooliOsui2(PhysicsObject ammus, PhysicsObject kohde) 1966 { 1967 if (AmmusVoiOsua(ammus, kohde)) 1968 { 1969 Pelaaja p = (Pelaaja)kohde; 1970 if (p.DamageResistance == true) 1971 { 1972 p.HPLaskuri.Value -= 12; 1973 } 1974 else if (p.DamageVulnerability == true) 1975 { 1976 p.HPLaskuri.Value -= 37; 1977 } 1978 else 1979 { 1980 p.HPLaskuri.Value -= 25; 1981 } 1982 } 1983 } 1984 void PistooliOsui3(PhysicsObject ammus, PhysicsObject kohde) 1985 { 1986 if (AmmusVoiOsua(ammus, kohde)) 1987 { 1988 Pelaaja p = (Pelaaja)kohde; 1989 if (p.DamageResistance == true) 1990 { 1991 p.HPLaskuri.Value -= 12; 1992 } 1993 else if (p.DamageVulnerability == true) 1994 { 1995 p.HPLaskuri.Value -= 37; 1996 } 1997 else 1998 { 1999 p.HPLaskuri.Value -= 25; 2000 } 2001 } 2002 } 2003 2004 void KivaariOsui(PhysicsObject ammus, PhysicsObject kohde) 2005 { 2006 if (AmmusVoiOsua(ammus, kohde)) 2007 { 2008 Pelaaja p = (Pelaaja)kohde; 2009 if (p.DamageResistance == true) 2010 { 2011 p.HPLaskuri.Value -= 5; 2012 } 2013 else if (p.DamageVulnerability == true) 2014 { 2015 p.HPLaskuri.Value -= 15; 2016 } 2017 else 2018 { 2019 p.HPLaskuri.Value -= 10; 2020 } 2021 } 2022 } 2023 void KivaariOsui2(PhysicsObject ammus, PhysicsObject kohde) 2024 { 2025 if (AmmusVoiOsua(ammus, kohde)) 2026 { 2027 Pelaaja p = (Pelaaja)kohde; 2028 if (p.DamageResistance == true) 2029 { 2030 p.HPLaskuri.Value -= 7; 2031 } 2032 else if (p.DamageVulnerability == true) 2033 { 2034 p.HPLaskuri.Value -= 22; 2035 } 2036 else 2037 { 2038 p.HPLaskuri.Value -= 15; 2039 } 2040 } 2041 } 2042 void KivaariOsui3(PhysicsObject ammus, PhysicsObject kohde) 2043 { 2044 if (AmmusVoiOsua(ammus, kohde)) 2045 { 2046 Pelaaja p = (Pelaaja)kohde; 2047 if (p.DamageResistance == true) 2048 { 2049 p.HPLaskuri.Value -= 10; 2050 } 2051 else if (p.DamageVulnerability == true) 2052 { 2053 p.HPLaskuri.Value -= 30; 2054 } 2055 else 2056 { 2057 p.HPLaskuri.Value -= 20; 2058 } 2059 } 2060 } 2061 2062 void SniperOsui(PhysicsObject ammus, PhysicsObject kohde) 2063 { 2064 if (AmmusVoiOsua(ammus, kohde)) 2065 { 2066 Pelaaja p = (Pelaaja)kohde; 2067 if (p.DamageResistance == true) 2068 { 2069 p.HPLaskuri.Value -= 40; 2070 } 2071 else if (p.DamageVulnerability == true) 2072 { 2073 p.HPLaskuri.Value -= 120; 2074 } 2075 else 2076 { 2077 p.HPLaskuri.Value -= 80; 2078 } 2079 } 2080 } 2081 void SniperOsui2(PhysicsObject ammus, PhysicsObject kohde) 2082 { 2083 if (AmmusVoiOsua(ammus, kohde)) 2084 { 2085 Pelaaja p = (Pelaaja)kohde; 2086 if (p.DamageResistance == true) 2087 { 2088 p.HPLaskuri.Value -= 45; 2089 } 2090 else if (p.DamageVulnerability == true) 2091 { 2092 p.HPLaskuri.Value -= 135; 2093 } 2094 else 2095 { 2096 p.HPLaskuri.Value -= 90; 2097 } 2098 } 2099 } 2100 void SniperOsui3(PhysicsObject ammus, PhysicsObject kohde) 2101 { 2102 if (AmmusVoiOsua(ammus, kohde)) 2103 { 2104 Pelaaja p = (Pelaaja)kohde; 2105 if (p.DamageResistance == true) 2106 { 2107 p.HPLaskuri.Value -= 20; 2108 } 2109 else if (p.DamageVulnerability == true) 2110 { 2111 p.HPLaskuri.Value -= 60; 2112 } 2113 else 2114 { 2115 p.HPLaskuri.Value -= 40; 2116 } 2117 } 2118 } 2119 void SniperOsui4(PhysicsObject ammus, PhysicsObject kohde) 2120 { 2121 if (AmmusVoiOsua(ammus, kohde)) 2122 { 2123 Pelaaja p = (Pelaaja)kohde; 2124 if (p.DamageResistance == true) 2125 { 2126 p.HPLaskuri.Value -= 37; 2127 } 2128 else if (p.DamageVulnerability == true) 2129 { 2130 p.HPLaskuri.Value -= 112; 2131 } 2132 else 2133 { 2134 p.HPLaskuri.Value -= 75; 2135 } 2136 } 2137 } 2138 2139 void MagnumOsui(PhysicsObject ammus, PhysicsObject kohde) 2140 { 2141 if (AmmusVoiOsua(ammus, kohde)) 2142 { 2143 Pelaaja p = (Pelaaja)kohde; 2144 if (p.DamageResistance == true) 2145 { 2146 p.HPLaskuri.Value -= 26; 2147 } 2148 else if (p.DamageVulnerability == true) 2149 { 2150 p.HPLaskuri.Value -= 70; 2151 } 2152 else 2153 { 2154 p.HPLaskuri.Value -= 35; 2155 } 2156 } 2157 } 2158 void MagnumOsui2(PhysicsObject ammus, PhysicsObject kohde) 2159 { 2160 if (AmmusVoiOsua(ammus, kohde)) 2161 { 2162 Pelaaja p = (Pelaaja)kohde; 2163 if (p.DamageResistance == true) 2164 { 2165 p.HPLaskuri.Value -= 30; 2166 } 2167 else if (p.DamageVulnerability == true) 2168 { 2169 p.HPLaskuri.Value -= 80; 2170 } 2171 else 2172 { 2173 p.HPLaskuri.Value -= 40; 2174 } 2175 } 2176 } 2177 void MagnumOsui3(PhysicsObject ammus, PhysicsObject kohde) 2178 { 2179 if (AmmusVoiOsua(ammus, kohde)) 2180 { 2181 Pelaaja p = (Pelaaja)kohde; 2182 if (p.DamageResistance == true) 2183 { 2184 p.HPLaskuri.Value -= 37; 2185 } 2186 else if (p.DamageVulnerability == true) 2187 { 2188 p.HPLaskuri.Value -= 100; 2189 } 2190 else 2191 { 2192 p.HPLaskuri.Value -= 50; 2193 } 2194 } 2195 } 2196 void MagnumOsui4(PhysicsObject ammus, PhysicsObject kohde) 2197 { 2198 if (AmmusVoiOsua(ammus, kohde)) 2199 { 2200 Pelaaja p = (Pelaaja)kohde; 2201 if (p.DamageResistance == true) 2202 { 2203 p.HPLaskuri.Value -= 75; 2204 } 2205 else if (p.DamageVulnerability == true) 2206 { 2207 p.HPLaskuri.Value -= 200; 2208 } 2209 else 2210 { 2211 p.HPLaskuri.Value -= 100; 2212 } 2213 } 2214 } 2215 2216 void HaulikkoOsui(PhysicsObject ammus, PhysicsObject kohde) 2217 { 2218 if (AmmusVoiOsua(ammus, kohde)) 2219 { 2220 Pelaaja p = (Pelaaja)kohde; 2221 if (p.DamageResistance == true) 2222 { 2223 p.HPLaskuri.Value -= 6; 2224 } 2225 else if (p.DamageVulnerability == true) 2226 { 2227 p.HPLaskuri.Value -= 19; 2228 } 2229 else 2230 { 2231 p.HPLaskuri.Value -= 13; 2232 } 2233 } 2234 } 2235 void HaulikkoOsui2(PhysicsObject ammus, PhysicsObject kohde) 2236 { 2237 if (AmmusVoiOsua(ammus, kohde)) 2238 { 2239 Pelaaja p = (Pelaaja)kohde; 2240 if (p.DamageResistance == true) 2241 { 2242 p.HPLaskuri.Value -= 7; 2243 } 2244 else if (p.DamageVulnerability == true) 2245 { 2246 p.HPLaskuri.Value -= 22; 2247 } 2248 else 2249 { 2250 p.HPLaskuri.Value -= 15; 2251 } 2252 } 2253 } 2254 void HaulikkoOsui3(PhysicsObject ammus, PhysicsObject kohde) 2255 { 2256 if (AmmusVoiOsua(ammus, kohde)) 2257 { 2258 Pelaaja p = (Pelaaja)kohde; 2259 if (p.DamageResistance == true) 2260 { 2261 p.HPLaskuri.Value -= 7; 2262 } 2263 else if (p.DamageVulnerability == true) 2264 { 2265 p.HPLaskuri.Value -= 22; 2266 } 2267 else 2268 { 2269 p.HPLaskuri.Value -= 15; 2270 } 2271 } 2272 } 2273 2274 void MiekkaOsui(PhysicsObject ammus, PhysicsObject kohde) 2275 { 2276 if (AmmusVoiOsua(ammus, kohde)) 2277 { 2278 Pelaaja p = (Pelaaja)kohde; 2279 if (p.DamageResistance == true) 2280 { 2281 p.HPLaskuri.Value -= 5; 2282 } 2283 else if (p.DamageVulnerability == true) 2284 { 2285 p.HPLaskuri.Value -= 15; 2286 } 2287 else 2288 { 2289 p.HPLaskuri.Value -= 10; 2290 } 2291 } 2292 } 2293 2294 void FlareOsui(PhysicsObject ammus, PhysicsObject kohde) 2295 { 2296 if (AmmusVoiOsua(ammus, kohde)) 2297 { 2298 Pelaaja p = (Pelaaja)kohde; 2299 2300 GameObject liekki = new GameObject(40, 40); 2301 liekki.Color = new Color(Color.Orange, 100); 2302 liekki.Shape = Shape.FromImage(norsu); 2303 2304 p.Add(liekki); 2305 Timer.SingleShot(1.0, delegate { p.Remove(liekki); }); 2306 2307 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 7; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 22; } else { p.HPLaskuri.Value -= 15; } 2308 Timer.SingleShot(0.5, delegate { if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 2309 Timer.SingleShot(0.5, delegate { if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } }); 2310 }); 2311 2312 } 2313 } 2314 2315 void FlareOsui2(PhysicsObject ammus, PhysicsObject kohde) 2316 { 2317 if (AmmusVoiOsua(ammus, kohde)) 2318 { 2319 Pelaaja p = (Pelaaja)kohde; 2320 2321 GameObject liekki = new GameObject(40, 40); 2322 liekki.Color = new Color(Color.Orange, 100); 2323 liekki.Shape = Shape.FromImage(norsu); 2324 2325 p.Add(liekki); 2326 Timer.SingleShot(2.0, delegate { p.Remove(liekki); }); 2327 2328 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 10; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 30; } else { p.HPLaskuri.Value -= 20; } 1945 2329 Timer.SingleShot(0.5, delegate 1946 2330 { 1947 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }2331 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 1948 2332 Timer.SingleShot(0.5, delegate 1949 2333 { 1950 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }2334 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 1951 2335 Timer.SingleShot(0.5, delegate 1952 2336 { 1953 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }2337 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 1954 2338 Timer.SingleShot(0.5, delegate 1955 2339 { 1956 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2340 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 7; } else { p.HPLaskuri.Value -= 5; } 2341 }); 2342 }); 2343 }); 2344 }); 2345 2346 } 2347 } 2348 void FlareOsui3(PhysicsObject ammus, PhysicsObject kohde) 2349 { 2350 if (AmmusVoiOsua(ammus, kohde)) 2351 { 2352 Pelaaja p = (Pelaaja)kohde; 2353 2354 GameObject liekki = new GameObject(40, 40); 2355 liekki.Color = new Color(Color.Orange, 100); 2356 liekki.Shape = Shape.FromImage(norsu); 2357 2358 p.Add(liekki); 2359 Timer.SingleShot(2.5, delegate { p.Remove(liekki); }); 2360 2361 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 15; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 45; } else { p.HPLaskuri.Value -= 30; } 2362 2363 Timer.SingleShot(0.5, delegate 2364 { 2365 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 2366 Timer.SingleShot(0.5, delegate 2367 { 2368 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 2369 Timer.SingleShot(0.5, delegate 2370 { 2371 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 2372 Timer.SingleShot(0.5, delegate 2373 { 2374 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 1957 2375 Timer.SingleShot(0.5, delegate 1958 2376 { 1959 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; }2377 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 10; } else { p.HPLaskuri.Value -= 7; } 1960 2378 }); 1961 2379 }); … … 1963 2381 }); 1964 2382 }); 1965 }); 1966 } 1967 } 1968 1969 bool AmmusVoiOsua(PhysicsObject ammus, PhysicsObject kohde) 1970 { 1971 if (ammus.IsDestroying) return false; 1972 if (kohde.Tag.ToString() != "ammus" && kohde.Tag.ToString() != "") ammus.Destroy(); 1973 if (kohde is Pelaaja) 1974 { 1975 return true; 1976 } 1977 else 1978 { 1979 return false; 1980 } 1981 } 1982 1983 void PistooliOsui(PhysicsObject ammus, PhysicsObject kohde) 2383 2384 } 2385 } 2386 2387 void FlareOsui4(PhysicsObject ammus, PhysicsObject kohde) 1984 2388 { 1985 2389 if (AmmusVoiOsua(ammus, kohde)) 1986 2390 { 1987 2391 Pelaaja p = (Pelaaja)kohde; 1988 if (p.DamageResistance == true) 1989 { 1990 p.HPLaskuri.Value -= 7; 1991 } 1992 else 1993 { 1994 p.HPLaskuri.Value -= 15; 1995 } 1996 } 1997 } 1998 void PistooliOsui2(PhysicsObject ammus, PhysicsObject kohde) 1999 { 2000 if (AmmusVoiOsua(ammus, kohde)) 2001 { 2002 Pelaaja p = (Pelaaja)kohde; 2003 if (p.DamageResistance == true) 2004 { 2005 p.HPLaskuri.Value -= 12; 2006 } 2007 else 2008 { 2009 p.HPLaskuri.Value -= 25; 2010 } 2011 } 2012 } 2013 void PistooliOsui3(PhysicsObject ammus, PhysicsObject kohde) 2014 { 2015 if (AmmusVoiOsua(ammus, kohde)) 2016 { 2017 Pelaaja p = (Pelaaja)kohde; 2018 if (p.DamageResistance == true) 2019 { 2020 p.HPLaskuri.Value -= 12; 2021 } 2022 else 2023 { 2024 p.HPLaskuri.Value -= 25; 2025 } 2026 } 2027 } 2028 2029 void KivaariOsui(PhysicsObject ammus, PhysicsObject kohde) 2030 { 2031 if (AmmusVoiOsua(ammus, kohde)) 2032 { 2033 Pelaaja p = (Pelaaja)kohde; 2034 if (p.DamageResistance == true) 2035 { 2036 p.HPLaskuri.Value -= 5; 2037 } 2038 else 2039 { 2040 p.HPLaskuri.Value -= 10; 2041 } 2042 } 2043 } 2044 void KivaariOsui2(PhysicsObject ammus, PhysicsObject kohde) 2045 { 2046 if (AmmusVoiOsua(ammus, kohde)) 2047 { 2048 Pelaaja p = (Pelaaja)kohde; 2049 if (p.DamageResistance == true) 2050 { 2051 p.HPLaskuri.Value -= 7; 2052 } 2053 else 2054 { 2055 p.HPLaskuri.Value -= 15; 2056 } 2057 } 2058 } 2059 void KivaariOsui3(PhysicsObject ammus, PhysicsObject kohde) 2060 { 2061 if (AmmusVoiOsua(ammus, kohde)) 2062 { 2063 Pelaaja p = (Pelaaja)kohde; 2064 if (p.DamageResistance == true) 2065 { 2066 p.HPLaskuri.Value -= 10; 2067 } 2068 else 2069 { 2070 p.HPLaskuri.Value -= 20; 2071 } 2072 } 2073 } 2074 2075 void SniperOsui(PhysicsObject ammus, PhysicsObject kohde) 2076 { 2077 if (AmmusVoiOsua(ammus, kohde)) 2078 { 2079 Pelaaja p = (Pelaaja)kohde; 2080 if (p.DamageResistance == true) 2081 { 2082 p.HPLaskuri.Value -= 40; 2083 } 2084 else 2085 { 2086 p.HPLaskuri.Value -= 80; 2087 } 2088 } 2089 } 2090 void SniperOsui2(PhysicsObject ammus, PhysicsObject kohde) 2091 { 2092 if (AmmusVoiOsua(ammus, kohde)) 2093 { 2094 Pelaaja p = (Pelaaja)kohde; 2095 if (p.DamageResistance == true) 2096 { 2097 p.HPLaskuri.Value -= 45; 2098 } 2099 else 2100 { 2101 p.HPLaskuri.Value -= 90; 2102 } 2103 } 2104 } 2105 void SniperOsui3(PhysicsObject ammus, PhysicsObject kohde) 2106 { 2107 if (AmmusVoiOsua(ammus, kohde)) 2108 { 2109 Pelaaja p = (Pelaaja)kohde; 2110 if (p.DamageResistance == true) 2111 { 2112 p.HPLaskuri.Value -= 20; 2113 } 2114 else 2115 { 2116 p.HPLaskuri.Value -= 40; 2117 } 2118 } 2119 } 2120 void SniperOsui4(PhysicsObject ammus, PhysicsObject kohde) 2121 { 2122 if (AmmusVoiOsua(ammus, kohde)) 2123 { 2124 Pelaaja p = (Pelaaja)kohde; 2125 if (p.DamageResistance == true) 2126 { 2127 p.HPLaskuri.Value -= 37; 2128 } 2129 else 2130 { 2131 p.HPLaskuri.Value -= 75; 2132 } 2133 } 2134 } 2135 2136 void MagnumOsui(PhysicsObject ammus, PhysicsObject kohde) 2137 { 2138 if (AmmusVoiOsua(ammus, kohde)) 2139 { 2140 Pelaaja p = (Pelaaja)kohde; 2141 if (p.DamageResistance == true) 2142 { 2143 p.HPLaskuri.Value -= 26; 2144 } 2145 else 2146 { 2147 p.HPLaskuri.Value -= 35; 2148 } 2149 } 2150 } 2151 void MagnumOsui2(PhysicsObject ammus, PhysicsObject kohde) 2152 { 2153 if (AmmusVoiOsua(ammus, kohde)) 2154 { 2155 Pelaaja p = (Pelaaja)kohde; 2156 if (p.DamageResistance == true) 2157 { 2158 p.HPLaskuri.Value -= 30; 2159 } 2160 else 2161 { 2162 p.HPLaskuri.Value -= 40; 2163 } 2164 } 2165 } 2166 void MagnumOsui3(PhysicsObject ammus, PhysicsObject kohde) 2167 { 2168 if (AmmusVoiOsua(ammus, kohde)) 2169 { 2170 Pelaaja p = (Pelaaja)kohde; 2171 if (p.DamageResistance == true) 2172 { 2173 p.HPLaskuri.Value -= 37; 2174 } 2175 else 2176 { 2177 p.HPLaskuri.Value -= 50; 2178 } 2179 } 2180 } 2181 void MagnumOsui4(PhysicsObject ammus, PhysicsObject kohde) 2182 { 2183 if (AmmusVoiOsua(ammus, kohde)) 2184 { 2185 Pelaaja p = (Pelaaja)kohde; 2186 if (p.DamageResistance == true) 2187 { 2188 p.HPLaskuri.Value -= 75; 2189 } 2190 else 2191 { 2192 p.HPLaskuri.Value -= 100; 2193 } 2194 } 2195 } 2196 2197 void HaulikkoOsui(PhysicsObject ammus, PhysicsObject kohde) 2198 { 2199 if (AmmusVoiOsua(ammus, kohde)) 2200 { 2201 Pelaaja p = (Pelaaja)kohde; 2202 if (p.DamageResistance == true) 2203 { 2204 p.HPLaskuri.Value -= 6; 2205 } 2206 else 2207 { 2208 p.HPLaskuri.Value -= 13; 2209 } 2210 } 2211 } 2212 void HaulikkoOsui2(PhysicsObject ammus, PhysicsObject kohde) 2213 { 2214 if (AmmusVoiOsua(ammus, kohde)) 2215 { 2216 Pelaaja p = (Pelaaja)kohde; 2217 if (p.DamageResistance == true) 2218 { 2219 p.HPLaskuri.Value -= 7; 2220 } 2221 else 2222 { 2223 p.HPLaskuri.Value -= 15; 2224 } 2225 } 2226 } 2227 void HaulikkoOsui3(PhysicsObject ammus, PhysicsObject kohde) 2228 { 2229 if (AmmusVoiOsua(ammus, kohde)) 2230 { 2231 Pelaaja p = (Pelaaja)kohde; 2232 if (p.DamageResistance == true) 2233 { 2234 p.HPLaskuri.Value -= 7; 2235 } 2236 else 2237 { 2238 p.HPLaskuri.Value -= 15; 2239 } 2240 } 2241 } 2242 2243 void MiekkaOsui(PhysicsObject ammus, PhysicsObject kohde) 2244 { 2245 if (AmmusVoiOsua(ammus, kohde)) 2246 { 2247 Pelaaja p = (Pelaaja)kohde; 2248 if (p.DamageResistance == true) 2249 { 2250 p.HPLaskuri.Value -= 5; 2251 } 2252 else 2253 { 2254 p.HPLaskuri.Value -= 10; 2255 } 2256 } 2257 } 2258 2259 void FlareOsui(PhysicsObject ammus, PhysicsObject kohde) 2260 { 2261 if (AmmusVoiOsua(ammus, kohde)) 2262 { 2263 Pelaaja p = (Pelaaja)kohde; 2264 if (p.DamageResistance == true) 2265 { 2266 GameObject liekki = new GameObject(40, 40); 2267 liekki.Color = new Color(Color.Orange, 100); 2268 liekki.Shape = Shape.FromImage(norsu); 2269 2270 p.Add(liekki); 2271 Timer.SingleShot(1.0, delegate { p.Remove(liekki); }); 2272 2273 p.HPLaskuri.Value -= 7; 2274 Timer.SingleShot(0.5, delegate { if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2275 Timer.SingleShot(0.5, delegate { if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } }); 2276 }); 2277 } 2278 else 2279 { 2280 GameObject liekki = new GameObject(40, 40); 2281 liekki.Color = new Color(Color.Orange, 100); 2282 liekki.Shape = Shape.FromImage(norsu); 2283 2284 p.Add(liekki); 2285 Timer.SingleShot(1.0, delegate { p.Remove(liekki); }); 2286 2287 p.HPLaskuri.Value -= 15; 2288 Timer.SingleShot(0.5, delegate { if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2289 Timer.SingleShot(0.5, delegate { if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } }); 2290 }); 2291 2292 } 2293 } 2294 } 2295 2296 void FlareOsui2(PhysicsObject ammus, PhysicsObject kohde) 2297 { 2298 if (AmmusVoiOsua(ammus, kohde)) 2299 { 2300 Pelaaja p = (Pelaaja)kohde; 2301 if (p.DamageResistance == true) 2302 { 2303 GameObject liekki = new GameObject(40, 40); 2304 liekki.Color = new Color(Color.Orange, 100); 2305 liekki.Shape = Shape.FromImage(norsu); 2306 2307 p.Add(liekki); 2308 Timer.SingleShot(2.0, delegate { p.Remove(liekki); }); 2309 2310 p.HPLaskuri.Value -= 10; 2311 Timer.SingleShot(0.5, delegate 2312 { 2313 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2314 Timer.SingleShot(0.5, delegate 2315 { 2316 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2317 Timer.SingleShot(0.5, delegate 2318 { 2319 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2320 Timer.SingleShot(0.5, delegate 2321 { 2322 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2323 }); 2324 }); 2325 }); 2326 }); 2327 } 2328 else 2329 { 2330 GameObject liekki = new GameObject(40, 40); 2331 liekki.Color = new Color(Color.Orange, 100); 2332 liekki.Shape = Shape.FromImage(norsu); 2333 2334 p.Add(liekki); 2335 Timer.SingleShot(2.0, delegate { p.Remove(liekki); }); 2336 2337 p.HPLaskuri.Value -= 20; 2338 Timer.SingleShot(0.5, delegate 2339 { 2340 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2341 Timer.SingleShot(0.5, delegate 2342 { 2343 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2344 Timer.SingleShot(0.5, delegate 2345 { 2346 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2347 Timer.SingleShot(0.5, delegate 2348 { 2349 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 2; } else { p.HPLaskuri.Value -= 5; } 2350 }); 2351 }); 2352 }); 2353 }); 2354 2355 } 2356 } 2357 } 2358 void FlareOsui3(PhysicsObject ammus, PhysicsObject kohde) 2359 { 2360 if (AmmusVoiOsua(ammus, kohde)) 2361 { 2362 Pelaaja p = (Pelaaja)kohde; 2363 if (p.DamageResistance == true) 2364 { 2365 GameObject liekki = new GameObject(40, 40); 2366 liekki.Color = new Color(Color.Orange, 100); 2367 liekki.Shape = Shape.FromImage(norsu); 2368 2369 p.Add(liekki); 2370 Timer.SingleShot(2.5, delegate { p.Remove(liekki); }); 2371 2372 p.HPLaskuri.Value -= 15; 2373 Timer.SingleShot(0.5, delegate 2374 { 2375 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2376 Timer.SingleShot(0.5, delegate 2377 { 2378 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2379 Timer.SingleShot(0.5, delegate 2380 { 2381 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2382 Timer.SingleShot(0.5, delegate 2383 { 2384 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2385 Timer.SingleShot(0.5, delegate 2386 { 2387 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2388 }); 2389 }); 2390 }); 2391 }); 2392 }); 2393 } 2394 else 2395 { 2396 GameObject liekki = new GameObject(40, 40); 2397 liekki.Color = new Color(Color.Orange, 100); 2398 liekki.Shape = Shape.FromImage(norsu); 2399 2400 p.Add(liekki); 2401 Timer.SingleShot(2.5, delegate { p.Remove(liekki); }); 2402 2403 p.HPLaskuri.Value -= 30; 2404 Timer.SingleShot(0.5, delegate 2405 { 2406 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2407 Timer.SingleShot(0.5, delegate 2408 { 2409 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2410 Timer.SingleShot(0.5, delegate 2411 { 2412 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2413 Timer.SingleShot(0.5, delegate 2414 { 2415 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2416 Timer.SingleShot(0.5, delegate 2417 { 2418 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 3; } else { p.HPLaskuri.Value -= 7; } 2419 }); 2420 }); 2421 }); 2422 }); 2423 }); 2424 } 2425 } 2426 } 2427 2428 void FlareOsui4(PhysicsObject ammus, PhysicsObject kohde) 2429 { 2430 if (AmmusVoiOsua(ammus, kohde)) 2431 { 2432 Pelaaja p = (Pelaaja)kohde; 2433 if (p.DamageResistance == true) 2434 { 2392 2435 2393 GameObject liekki = new GameObject(40, 40); 2436 2394 liekki.Color = new Color(Color.Red, 100); … … 2440 2398 Timer.SingleShot(5.0, delegate { p.Remove(liekki); }); 2441 2399 2442 p.HPLaskuri.Value -= 17; 2400 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 17; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 52; } else { p.HPLaskuri.Value -= 35; } 2401 2443 2402 Timer.SingleShot(0.5, delegate 2444 2403 { 2445 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2404 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2446 2405 Timer.SingleShot(0.5, delegate 2447 2406 { 2448 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2407 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2449 2408 Timer.SingleShot(0.5, delegate 2450 2409 { 2451 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2410 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2452 2411 Timer.SingleShot(0.5, delegate 2453 2412 { 2454 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2413 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2455 2414 Timer.SingleShot(0.5, delegate 2456 2415 { 2457 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2416 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2458 2417 Timer.SingleShot(0.5, delegate 2459 2418 { 2460 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2419 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2461 2420 Timer.SingleShot(0.5, delegate 2462 2421 { 2463 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2422 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2464 2423 Timer.SingleShot(0.5, delegate 2465 2424 { 2466 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2425 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2467 2426 Timer.SingleShot(0.5, delegate 2468 2427 { 2469 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2428 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2470 2429 Timer.SingleShot(0.5, delegate 2471 2430 { 2472 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; }2431 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else if (p.DamageVulnerability == true) { p.HPLaskuri.Value -= 15; } else { p.HPLaskuri.Value -= 10; } 2473 2432 }); 2474 2433 }); … … 2481 2440 }); 2482 2441 }); 2483 } 2484 else 2485 { 2486 GameObject liekki = new GameObject(40, 40); 2487 liekki.Color = new Color(Color.Red, 100); 2488 liekki.Shape = Shape.FromImage(norsu); 2489 2490 p.Add(liekki); 2491 Timer.SingleShot(5.0, delegate { p.Remove(liekki); }); 2492 2493 p.HPLaskuri.Value -= 35; 2494 Timer.SingleShot(0.5, delegate 2495 { 2496 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2497 Timer.SingleShot(0.5, delegate 2498 { 2499 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2500 Timer.SingleShot(0.5, delegate 2501 { 2502 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2503 Timer.SingleShot(0.5, delegate 2504 { 2505 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2506 Timer.SingleShot(0.5, delegate 2507 { 2508 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2509 Timer.SingleShot(0.5, delegate 2510 { 2511 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2512 Timer.SingleShot(0.5, delegate 2513 { 2514 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2515 Timer.SingleShot(0.5, delegate 2516 { 2517 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2518 Timer.SingleShot(0.5, delegate 2519 { 2520 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2521 Timer.SingleShot(0.5, delegate 2522 { 2523 if (p.DamageResistance == true) { p.HPLaskuri.Value -= 5; } else { p.HPLaskuri.Value -= 10; } 2524 }); 2525 }); 2526 }); 2527 }); 2528 }); 2529 }); 2530 }); 2531 }); 2532 }); 2533 }); 2534 } 2442 2535 2443 } 2536 2444 } … … 2547 2455 p.HPLaskuri.Value -= 7; 2548 2456 } 2457 else if (p.DamageVulnerability == true) 2458 { 2459 p.HPLaskuri.Value -= 22; 2460 } 2549 2461 else 2550 2462 { … … 2563 2475 p.HPLaskuri.Value -= 30; 2564 2476 } 2477 else if (p.DamageVulnerability == true) 2478 { 2479 p.HPLaskuri.Value -= 80; 2480 } 2565 2481 else 2566 2482 { … … 2579 2495 p.HPLaskuri.Value -= 6; 2580 2496 } 2497 else if (p.DamageVulnerability == true) 2498 { 2499 p.HPLaskuri.Value -= 19; 2500 } 2581 2501 else 2582 2502 { … … 2594 2514 { 2595 2515 p.HPLaskuri.Value -= 100; 2516 } 2517 else if (p.DamageVulnerability == true) 2518 { 2519 p.HPLaskuri.Value -= 300; 2596 2520 } 2597 2521 else … … 2621 2545 pelaaja.HPLaskuri.Value -= 20; 2622 2546 } 2547 else if (pelaaja.DamageVulnerability == true) 2548 { 2549 pelaaja.HPLaskuri.Value -= 60; 2550 } 2623 2551 else 2624 2552 { … … 2647 2575 pelaaja.HPLaskuri.Value -= 25; 2648 2576 } 2577 else if (pelaaja.DamageVulnerability == true) 2578 { 2579 pelaaja.HPLaskuri.Value -= 75; 2580 } 2649 2581 else 2650 2582 { … … 2662 2594 { 2663 2595 p.HPLaskuri.Value -= 7; 2596 } 2597 else if (p.DamageVulnerability == true) 2598 { 2599 p.HPLaskuri.Value -= 22; 2664 2600 } 2665 2601 else … … 2690 2626 pelaaja.HPLaskuri.Value -= 15; 2691 2627 } 2628 else if (pelaaja.DamageVulnerability == true) 2629 { 2630 pelaaja.HPLaskuri.Value -= 45; 2631 } 2692 2632 else 2693 2633 { … … 2706 2646 p.HPLaskuri.Value -= 15; 2707 2647 } 2648 else if (p.DamageVulnerability == true) 2649 { 2650 p.HPLaskuri.Value -= 45; 2651 } 2708 2652 else 2709 2653 { … … 2722 2666 p.HPLaskuri.Value -= 40; 2723 2667 } 2668 else if (p.DamageVulnerability == true) 2669 { 2670 p.HPLaskuri.Value -= 120; 2671 } 2724 2672 else 2725 2673 { … … 2738 2686 p.HPLaskuri.Value -= 7; 2739 2687 } 2688 else if (p.DamageVulnerability == true) 2689 { 2690 p.HPLaskuri.Value -= 22; 2691 } 2740 2692 else 2741 2693 { … … 2753 2705 { 2754 2706 p.HPLaskuri.Value -= 500; 2707 } 2708 else if (p.DamageVulnerability == true) 2709 { 2710 p.HPLaskuri.Value -= 1500; 2755 2711 } 2756 2712 else … … 2780 2736 pelaaja.HPLaskuri.Value -= 25; 2781 2737 } 2738 else if (pelaaja.DamageVulnerability == true) 2739 { 2740 pelaaja.HPLaskuri.Value -= 75; 2741 } 2782 2742 else 2783 2743 { … … 2806 2766 pelaaja.HPLaskuri.Value -= 35; 2807 2767 } 2768 else if (pelaaja.DamageVulnerability == true) 2769 { 2770 pelaaja.HPLaskuri.Value -= 105; 2771 } 2808 2772 else 2809 2773 { … … 2821 2785 { 2822 2786 p.HPLaskuri.Value -= 8; 2787 } 2788 else if (p.DamageVulnerability == true) 2789 { 2790 p.HPLaskuri.Value -= 25; 2823 2791 } 2824 2792 else … … 2848 2816 { 2849 2817 pelaaja.HPLaskuri.Value -= 20; 2818 } 2819 else if (pelaaja.DamageVulnerability == true) 2820 { 2821 pelaaja.HPLaskuri.Value -= 60; 2850 2822 } 2851 2823 else … … 3539 3511 if (aseenTag.Length >= 7 && aseenTag.Substring(0, 7) == "Kivääri") 3540 3512 { 3541 LuoAsePelaajalle("Sarjatulikivääri", pelaaja); 3542 } 3513 if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 3" || aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 4") 3514 { 3515 LuoAsePelaajalle("Sarjatulikivääri Lv. X", pelaaja); 3516 Timer.SingleShot(5.0, delegate 3517 { 3518 if (pelaaja.IsDestroyed == true) 3519 { 3520 return; 3521 } 3522 string aseTag = pelaaja.Weapon.Tag.ToString(); 3523 if (aseTag == "Sarjatulikivääri Lv. X") 3524 { 3525 saaAmpua = false; 3526 Timer.SingleShot(0.1, delegate 3527 { 3528 saaAmpua = true; 3529 }); LuoAsePelaajalle("Sarjatulikivääri", pelaaja); naytaTiedot(); 3530 } 3531 else 3532 { 3533 return; 3534 } 3535 }); 3536 } 3537 else if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 2") 3538 { 3539 LuoAsePelaajalle("Sarjatulikivääri", pelaaja); 3540 } 3541 3542 else 3543 { 3544 LuoAsePelaajalle("Sarjatulikivääri", pelaaja); 3545 { 3546 GameObject kilpi = new GameObject(50, 50, Shape.Circle); 3547 kilpi.Color = new Color(Color.Red, 40); 3548 pelaaja.Add(kilpi); 3549 pelaaja.DamageVulnerability = true; 3550 Timer.SingleShot(5.0, delegate { pelaaja.DamageVulnerability = false; pelaaja.Remove(kilpi); }); 3551 } 3552 } 3553 } 3554 3555 if (aseenTag.Length >= 16 && aseenTag.Substring(0, 16) == "Sarjatulikivääri") 3556 { 3557 LuoAsePelaajalle("Kivääri Lv. 4", pelaaja); 3558 Timer.SingleShot(5.0, delegate 3559 { 3560 if (pelaaja.IsDestroyed == true) 3561 { 3562 return; 3563 } 3564 string aseTag = pelaaja.Weapon.Tag.ToString(); 3565 if (aseTag == "Kivääri Lv. 4") 3566 { 3567 saaAmpua = false; 3568 Timer.SingleShot(0.1, delegate 3569 { 3570 saaAmpua = true; 3571 }); LuoAsePelaajalle("Kivääri Lv. 3", pelaaja); naytaTiedot(); 3572 } 3573 else 3574 { 3575 return; 3576 } 3577 }); 3578 } 3579 3580 3543 3581 if (aseenTag.Length >= 6 && aseenTag.Substring(0, 6) == "Magnum") 3544 3582 { 3545 LuoAsePelaajalle("Revolveri", pelaaja); 3546 } 3583 if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 3" || aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 4") 3584 { 3585 LuoAsePelaajalle("Revolveri Lv. X", pelaaja); 3586 Timer.SingleShot(5.0, delegate 3587 { 3588 if (pelaaja.IsDestroyed == true) 3589 { 3590 return; 3591 } 3592 string aseTag = pelaaja.Weapon.Tag.ToString(); 3593 if (aseTag == "Revolveri Lv. X") 3594 { 3595 saaAmpua = false; 3596 Timer.SingleShot(0.1, delegate 3597 { 3598 saaAmpua = true; 3599 }); LuoAsePelaajalle("Revolveri", pelaaja); naytaTiedot(); 3600 } 3601 else 3602 { 3603 return; 3604 } 3605 }); 3606 } 3607 else if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 2") 3608 { 3609 LuoAsePelaajalle("Revolveri", pelaaja); 3610 } 3611 3612 else 3613 { 3614 LuoAsePelaajalle("Revolveri", pelaaja); 3615 { 3616 GameObject kilpi = new GameObject(50, 50, Shape.Circle); 3617 kilpi.Color = new Color(Color.Red, 40); 3618 pelaaja.Add(kilpi); 3619 pelaaja.DamageVulnerability = true; 3620 Timer.SingleShot(5.0, delegate { pelaaja.DamageVulnerability = false; pelaaja.Remove(kilpi); }); 3621 } 3622 } 3623 } 3624 3625 if (aseenTag.Length >= 9 && aseenTag.Substring(0, 9) == "Revolveri") 3626 { 3627 LuoAsePelaajalle("Magnum Lv. 4", pelaaja); 3628 Timer.SingleShot(5.0, delegate 3629 { 3630 if (pelaaja.IsDestroyed == true) 3631 { 3632 return; 3633 } 3634 string aseTag = pelaaja.Weapon.Tag.ToString(); 3635 if (aseTag == "Magnum Lv. 4") 3636 { 3637 saaAmpua = false; 3638 Timer.SingleShot(0.1, delegate 3639 { 3640 saaAmpua = true; 3641 }); LuoAsePelaajalle("Magnum Lv. 3", pelaaja); naytaTiedot(); 3642 } 3643 else 3644 { 3645 return; 3646 } 3647 }); 3648 } 3649 3547 3650 if (aseenTag.Length >= 8 && aseenTag.Substring(0, 8) == "Haulikko") 3548 3651 { 3549 LuoAsePelaajalle("Katkaistu haulikko", pelaaja); 3550 } 3652 if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 3" || aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 4") 3653 { 3654 LuoAsePelaajalle("Katkaistu haulikko Lv. X", pelaaja); 3655 Timer.SingleShot(5.0, delegate 3656 { 3657 if (pelaaja.IsDestroyed == true) 3658 { 3659 return; 3660 } 3661 string aseTag = pelaaja.Weapon.Tag.ToString(); 3662 if (aseTag == "Katkaistu haulikko Lv. X") 3663 { 3664 saaAmpua = false; 3665 Timer.SingleShot(0.1, delegate 3666 { 3667 saaAmpua = true; 3668 }); LuoAsePelaajalle("Katkaistu haulikko", pelaaja); naytaTiedot(); 3669 } 3670 else 3671 { 3672 return; 3673 } 3674 }); 3675 } 3676 else if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 2") 3677 { 3678 LuoAsePelaajalle("Katkaistu haulikko", pelaaja); 3679 } 3680 3681 else 3682 { 3683 LuoAsePelaajalle("Katkaistu haulikko", pelaaja); 3684 { 3685 GameObject kilpi = new GameObject(50, 50, Shape.Circle); 3686 kilpi.Color = new Color(Color.Red, 40); 3687 pelaaja.Add(kilpi); 3688 pelaaja.DamageVulnerability = true; 3689 Timer.SingleShot(5.0, delegate { pelaaja.DamageVulnerability = false; pelaaja.Remove(kilpi); }); 3690 } 3691 } 3692 } 3693 3694 if (aseenTag.Length >= 18 && aseenTag.Substring(0, 18) == "Katkaistu haulikko") 3695 { 3696 LuoAsePelaajalle("Haulikko Lv. 4", pelaaja); 3697 Timer.SingleShot(5.0, delegate 3698 { 3699 if (pelaaja.IsDestroyed == true) 3700 { 3701 return; 3702 } 3703 string aseTag = pelaaja.Weapon.Tag.ToString(); 3704 if (aseTag == "Haulikko Lv. 4") 3705 { 3706 saaAmpua = false; 3707 Timer.SingleShot(0.1, delegate 3708 { 3709 saaAmpua = true; 3710 }); LuoAsePelaajalle("Haulikko Lv. 3", pelaaja); naytaTiedot(); 3711 } 3712 else 3713 { 3714 return; 3715 } 3716 }); 3717 } 3718 3551 3719 if (aseenTag.Length >= 6 && aseenTag.Substring(0, 6) == "Sniper") 3552 3720 { 3553 LuoAsePelaajalle("Panssari-Sniper", pelaaja); 3554 } 3721 if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 3" || aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 4") 3722 { 3723 LuoAsePelaajalle("Panssari-Sniper Lv. X", pelaaja); 3724 Timer.SingleShot(5.0, delegate 3725 { 3726 if (pelaaja.IsDestroyed == true) 3727 { 3728 return; 3729 } 3730 string aseTag = pelaaja.Weapon.Tag.ToString(); 3731 if (aseTag == "Panssari-Sniper Lv. X") 3732 { 3733 saaAmpua = false; 3734 Timer.SingleShot(0.1, delegate 3735 { 3736 saaAmpua = true; 3737 }); LuoAsePelaajalle("Panssari-Sniper", pelaaja); naytaTiedot(); 3738 } 3739 else 3740 { 3741 return; 3742 } 3743 }); 3744 } 3745 else if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 2") 3746 { 3747 LuoAsePelaajalle("Panssari-Sniper", pelaaja); 3748 } 3749 3750 else 3751 { 3752 LuoAsePelaajalle("Panssari-Sniper", pelaaja); 3753 { 3754 GameObject kilpi = new GameObject(50, 50, Shape.Circle); 3755 kilpi.Color = new Color(Color.Red, 40); 3756 pelaaja.Add(kilpi); 3757 pelaaja.DamageVulnerability = true; 3758 Timer.SingleShot(5.0, delegate { pelaaja.DamageVulnerability = false; pelaaja.Remove(kilpi); }); 3759 } 3760 } 3761 } 3762 3763 if (aseenTag.Length >= 15 && aseenTag.Substring(0, 15) == "Panssari-Sniper") 3764 { 3765 LuoAsePelaajalle("Sniper Lv. 4", pelaaja); 3766 Timer.SingleShot(5.0, delegate 3767 { 3768 if (pelaaja.IsDestroyed == true) 3769 { 3770 return; 3771 } 3772 string aseTag = pelaaja.Weapon.Tag.ToString(); 3773 if (aseTag == "Sniper Lv. 4") 3774 { 3775 saaAmpua = false; 3776 Timer.SingleShot(0.1, delegate 3777 { 3778 saaAmpua = true; 3779 }); LuoAsePelaajalle("Sniper Lv. 3", pelaaja); naytaTiedot(); 3780 } 3781 else 3782 { 3783 return; 3784 } 3785 }); 3786 } 3787 3555 3788 if (aseenTag.Length >= 15 && aseenTag.Substring(0, 15) == "Kranaatinheitin") 3556 3789 { 3557 LuoAsePelaajalle("Sirpalekranaatinheitin", pelaaja); 3558 } 3790 if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 3" || aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 4") 3791 { 3792 LuoAsePelaajalle("Sirpalekranaatinheitin Lv. X", pelaaja); 3793 Timer.SingleShot(5.0, delegate 3794 { 3795 if (pelaaja.IsDestroyed == true) 3796 { 3797 return; 3798 } 3799 string aseTag = pelaaja.Weapon.Tag.ToString(); 3800 if (aseTag == "Sirpalekranaatinheitin Lv. X") 3801 { 3802 saaAmpua = false; 3803 Timer.SingleShot(0.1, delegate 3804 { 3805 saaAmpua = true; 3806 }); LuoAsePelaajalle("Sirpalekranaatinheitin", pelaaja); naytaTiedot(); 3807 } 3808 else 3809 { 3810 return; 3811 } 3812 }); 3813 } 3814 else if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 2") 3815 { 3816 LuoAsePelaajalle("Sirpalekranaatinheitin", pelaaja); 3817 } 3818 3819 else 3820 { 3821 LuoAsePelaajalle("Sirpalekranaatinheitin", pelaaja); 3822 { 3823 GameObject kilpi = new GameObject(50, 50, Shape.Circle); 3824 kilpi.Color = new Color(Color.Red, 40); 3825 pelaaja.Add(kilpi); 3826 pelaaja.DamageVulnerability = true; 3827 Timer.SingleShot(5.0, delegate { pelaaja.DamageVulnerability = false; pelaaja.Remove(kilpi); }); 3828 } 3829 } 3830 } 3831 3832 if (aseenTag.Length >= 22 && aseenTag.Substring(0, 22) == "Sirpalekranaatinheitin") 3833 { 3834 LuoAsePelaajalle("Kranaatinheitin Lv. 4", pelaaja); 3835 Timer.SingleShot(5.0, delegate 3836 { 3837 if (pelaaja.IsDestroyed == true) 3838 { 3839 return; 3840 } 3841 string aseTag = pelaaja.Weapon.Tag.ToString(); 3842 if (aseTag == "Kranaatinheitin Lv. 4") 3843 { 3844 saaAmpua = false; 3845 Timer.SingleShot(0.1, delegate 3846 { 3847 saaAmpua = true; 3848 }); LuoAsePelaajalle("Kranaatinheitin Lv. 3", pelaaja); naytaTiedot(); 3849 } 3850 else 3851 { 3852 return; 3853 } 3854 }); 3855 } 3856 3559 3857 if (aseenTag.Length >= 13 && aseenTag.Substring(0, 13) == "Raketinheitin") 3560 3858 { 3561 LuoAsePelaajalle("Sinko", pelaaja); 3562 } 3859 if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 3" || aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 4") 3860 { 3861 LuoAsePelaajalle("Sinko Lv. X", pelaaja); 3862 Timer.SingleShot(5.0, delegate 3863 { 3864 if (pelaaja.IsDestroyed == true) 3865 { 3866 return; 3867 } 3868 string aseTag = pelaaja.Weapon.Tag.ToString(); 3869 if (aseTag == "Sinko Lv. X") 3870 { 3871 saaAmpua = false; 3872 Timer.SingleShot(0.1, delegate 3873 { 3874 saaAmpua = true; 3875 }); LuoAsePelaajalle("Sinko", pelaaja); naytaTiedot(); 3876 } 3877 else 3878 { 3879 return; 3880 } 3881 }); 3882 } 3883 else if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 2") 3884 { 3885 LuoAsePelaajalle("Sinko", pelaaja); 3886 } 3887 3888 else 3889 { 3890 LuoAsePelaajalle("Sinko", pelaaja); 3891 { 3892 GameObject kilpi = new GameObject(50, 50, Shape.Circle); 3893 kilpi.Color = new Color(Color.Red, 40); 3894 pelaaja.Add(kilpi); 3895 pelaaja.DamageVulnerability = true; 3896 Timer.SingleShot(5.0, delegate { pelaaja.DamageVulnerability = false; pelaaja.Remove(kilpi); }); 3897 } 3898 } 3899 } 3900 3901 if (aseenTag.Length >= 5 && aseenTag.Substring(0, 5) == "Sinko") 3902 { 3903 LuoAsePelaajalle("Raketinheitin Lv. 4", pelaaja); 3904 Timer.SingleShot(5.0, delegate 3905 { 3906 if (pelaaja.IsDestroyed == true) 3907 { 3908 return; 3909 } 3910 string aseTag = pelaaja.Weapon.Tag.ToString(); 3911 if (aseTag == "Raketinheitin Lv. 4") 3912 { 3913 saaAmpua = false; 3914 Timer.SingleShot(0.1, delegate 3915 { 3916 saaAmpua = true; 3917 }); LuoAsePelaajalle("Raketinheitin Lv. 3", pelaaja); naytaTiedot(); 3918 } 3919 else 3920 { 3921 return; 3922 } 3923 }); 3924 } 3925 3563 3926 if (aseenTag.Length >= 8 && aseenTag.Substring(0, 8) == "Pistooli") 3564 3927 { 3565 LuoAsePelaajalle("Konepistooli", pelaaja); 3928 if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 3" || aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 4") 3929 { 3930 LuoAsePelaajalle("Konepistooli Lv. X", pelaaja); 3931 Timer.SingleShot(5.0, delegate 3932 { 3933 if (pelaaja.IsDestroyed == true) 3934 { 3935 return; 3936 } 3937 string aseTag = pelaaja.Weapon.Tag.ToString(); 3938 if (aseTag == "Konepistooli Lv. X") 3939 { 3940 saaAmpua = false; 3941 Timer.SingleShot(0.1, delegate 3942 { 3943 saaAmpua = true; 3944 }); LuoAsePelaajalle("Konepistooli", pelaaja); naytaTiedot(); 3945 } 3946 else 3947 { 3948 return; 3949 } 3950 }); 3951 } 3952 else if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 2") 3953 { 3954 LuoAsePelaajalle("Konepistooli", pelaaja); 3955 } 3956 3957 else 3958 { 3959 LuoAsePelaajalle("Konepistooli", pelaaja); 3960 { 3961 GameObject kilpi = new GameObject(50, 50, Shape.Circle); 3962 kilpi.Color = new Color(Color.Red, 40); 3963 pelaaja.Add(kilpi); 3964 pelaaja.DamageVulnerability = true; 3965 Timer.SingleShot(5.0, delegate { pelaaja.DamageVulnerability = false; pelaaja.Remove(kilpi); }); 3966 } 3967 } 3968 } 3969 3970 if (aseenTag.Length >= 12 && aseenTag.Substring(0, 12) == "Konepistooli") 3971 { 3972 LuoAsePelaajalle("Pistooli Lv. 4", pelaaja); 3973 Timer.SingleShot(5.0, delegate 3974 { 3975 if (pelaaja.IsDestroyed == true) 3976 { 3977 return; 3978 } 3979 string aseTag = pelaaja.Weapon.Tag.ToString(); 3980 if (aseTag == "Pistooli Lv. 4") 3981 { 3982 saaAmpua = false; 3983 Timer.SingleShot(0.1, delegate 3984 { 3985 saaAmpua = true; 3986 }); LuoAsePelaajalle("Pistooli Lv. 3", pelaaja); naytaTiedot(); 3987 } 3988 else 3989 { 3990 return; 3991 } 3992 }); 3566 3993 } 3567 3994 … … 3569 3996 if (aseenTag.Length >= 12 && aseenTag.Substring(0, 12) == "Valopistooli") 3570 3997 { 3571 LuoAsePelaajalle("Räjähtävä valopistooli", pelaaja); 3998 if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 3" || aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 4") 3999 { 4000 LuoAsePelaajalle("Räjähtävä valopistooli Lv. X", pelaaja); 4001 Timer.SingleShot(5.0, delegate 4002 { 4003 if (pelaaja.IsDestroyed == true) 4004 { 4005 return; 4006 } 4007 string aseTag = pelaaja.Weapon.Tag.ToString(); 4008 if (aseTag == "Räjähtävä valopistooli Lv. X") 4009 { 4010 saaAmpua = false; 4011 Timer.SingleShot(0.1, delegate 4012 { 4013 saaAmpua = true; 4014 }); LuoAsePelaajalle("Räjähtävä valopistooli", pelaaja); naytaTiedot(); 4015 } 4016 else 4017 { 4018 return; 4019 } 4020 }); 4021 } 4022 else if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 2") 4023 { 4024 LuoAsePelaajalle("Räjähtävä valopistooli", pelaaja); 4025 } 4026 4027 else 4028 { 4029 LuoAsePelaajalle("Räjähtävä valopistooli", pelaaja); 4030 { 4031 GameObject kilpi = new GameObject(50, 50, Shape.Circle); 4032 kilpi.Color = new Color(Color.Red, 40); 4033 pelaaja.Add(kilpi); 4034 pelaaja.DamageVulnerability = true; 4035 Timer.SingleShot(5.0, delegate { pelaaja.DamageVulnerability = false; pelaaja.Remove(kilpi); }); 4036 } 4037 } 4038 } 4039 4040 if (aseenTag.Length >= 22 && aseenTag.Substring(0, 22) == "Räjähtävä valopistooli") 4041 { 4042 LuoAsePelaajalle("Valopistooli Lv. 4", pelaaja); 4043 Timer.SingleShot(5.0, delegate 4044 { 4045 if (pelaaja.IsDestroyed == true) 4046 { 4047 return; 4048 } 4049 string aseTag = pelaaja.Weapon.Tag.ToString(); 4050 if (aseTag == "Valopistooli Lv. 4") 4051 { 4052 saaAmpua = false; 4053 Timer.SingleShot(0.1, delegate 4054 { 4055 saaAmpua = true; 4056 }); LuoAsePelaajalle("Valopistooli Lv. 3", pelaaja); naytaTiedot(); 4057 } 4058 else 4059 { 4060 return; 4061 } 4062 }); 4063 } 4064 4065 if (aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. 4" || aseenTag.Length > 6 && aseenTag.Substring(aseenTag.Length - 5) == "Lv. X") 4066 { 4067 Explosion rajahdys = new Explosion(100); 4068 if (pelaaja == pelaaja1) 4069 { 4070 rajahdys.Position = pelaaja2.Position; 4071 if (pelaaja2.HPLaskuri.Value <= 1) 4072 { 4073 return; 4074 } 4075 if (pelaaja2.HPLaskuri.Value <= 25 && pelaaja2.DamageResistance == false && pelaaja2.DamageVulnerability == false || pelaaja2.HPLaskuri.Value <= 12 && pelaaja2.DamageResistance == true || pelaaja2.HPLaskuri.Value <= 37 && pelaaja2.DamageVulnerability == true && pelaaja2.DamageResistance == false) 4076 { 4077 pelaaja2.HPLaskuri.Value = 1; 4078 } 4079 else 4080 { 4081 if (pelaaja2.DamageResistance) 4082 { 4083 pelaaja2.HPLaskuri.Value -= 12; 4084 } 4085 else if (pelaaja2.DamageVulnerability) 4086 { 4087 pelaaja2.HPLaskuri.Value -= 37; 4088 } 4089 else 4090 { 4091 pelaaja2.HPLaskuri.Value -= 25; 4092 } 4093 } 4094 } 4095 if (pelaaja == pelaaja2) 4096 { 4097 rajahdys.Position = pelaaja1.Position; 4098 if (pelaaja1.HPLaskuri.Value <= 1) 4099 { 4100 return; 4101 } 4102 if (pelaaja1.HPLaskuri.Value <= 25 && pelaaja1.DamageResistance == false && pelaaja1.DamageVulnerability == false || pelaaja1.HPLaskuri.Value <= 12 && pelaaja1.DamageResistance == true || pelaaja1.HPLaskuri.Value <= 37 && pelaaja1.DamageVulnerability == true && pelaaja1.DamageResistance == false) 4103 { 4104 pelaaja1.HPLaskuri.Value = 1; 4105 } 4106 else 4107 { 4108 if (pelaaja1.DamageResistance) 4109 { 4110 pelaaja1.HPLaskuri.Value -= 12; 4111 } 4112 else if (pelaaja1.DamageVulnerability) 4113 { 4114 pelaaja1.HPLaskuri.Value -= 37; 4115 } 4116 else 4117 { 4118 pelaaja1.HPLaskuri.Value -= 25; 4119 } 4120 } 4121 } 4122 Add(rajahdys); 4123 rajahdys.Force = 0; 4124 rajahdys.Speed = 1000; 3572 4125 } 3573 4126 } … … 3827 4380 return; 3828 4381 } 3829 if (pelaaja2.HPLaskuri.Value <= 25 && pelaaja2.DamageResistance == false || pelaaja2.HPLaskuri.Value <= 12 && pelaaja2.DamageResistance == true)4382 if (pelaaja2.HPLaskuri.Value <= 25 && pelaaja2.DamageResistance == false && pelaaja2.DamageVulnerability == false || pelaaja2.HPLaskuri.Value <= 12 && pelaaja2.DamageResistance == true || pelaaja2.HPLaskuri.Value <= 37 && pelaaja2.DamageVulnerability == true && pelaaja2.DamageResistance == false) 3830 4383 { 3831 4384 pelaaja2.HPLaskuri.Value = 1; … … 3833 4386 else 3834 4387 { 3835 if (pelaaja2.DamageResistance == true)4388 if (pelaaja2.DamageResistance) 3836 4389 { 3837 4390 pelaaja2.HPLaskuri.Value -= 12; 3838 4391 } 4392 else if (pelaaja2.DamageVulnerability) 4393 { 4394 pelaaja2.HPLaskuri.Value -= 37; 4395 } 3839 4396 else 3840 4397 { … … 3850 4407 return; 3851 4408 } 3852 if (pelaaja1.HPLaskuri.Value <= 25 && pelaaja1.DamageResistance == false || pelaaja1.HPLaskuri.Value <= 12 && pelaaja1.DamageResistance == true)4409 if (pelaaja1.HPLaskuri.Value <= 25 && pelaaja1.DamageResistance == false && pelaaja1.DamageVulnerability == false || pelaaja1.HPLaskuri.Value <= 12 && pelaaja1.DamageResistance == true || pelaaja1.HPLaskuri.Value <= 37 && pelaaja1.DamageVulnerability == true && pelaaja1.DamageResistance == false) 3853 4410 { 3854 4411 pelaaja1.HPLaskuri.Value = 1; … … 3856 4413 else 3857 4414 { 3858 if (pelaaja1.DamageResistance == true)4415 if (pelaaja1.DamageResistance) 3859 4416 { 3860 4417 pelaaja1.HPLaskuri.Value -= 12; 4418 } 4419 else if (pelaaja1.DamageVulnerability) 4420 { 4421 pelaaja1.HPLaskuri.Value -= 37; 3861 4422 } 3862 4423 else
Note: See TracChangeset
for help on using the changeset viewer.