Advertisement
Guest User

Wc3 - Gui

a guest
Jul 11th, 2012
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.56 KB | None | 0 0
  1. Variablen
  2. Events
  3. Unit - A unit comes within 512.00 of Paladin 0001 <gen>
  4. Conditions
  5. (Unit-type of (Triggering unit)) Equal to Footman
  6. Actions
  7. Cinematic - Clear the screen of text messages for (All players)
  8. Set Geschwindigkeit_der_Einheit = (Current movement speed of (Triggering unit))
  9. Set Winkel = (Facing of (Triggering unit))
  10. Set Radius = 256.00
  11. Set Mittelpunkt = (Position of Paladin 0001 <gen>)
  12. -------- Position des Footman beim eintreten in den Kreis --------
  13. Set Schnittpunkt = (Position of (Triggering unit))
  14. Set X_Koordinate = (X of Schnittpunkt)
  15. Set Y_Koordinate = (Y of Schnittpunkt)
  16. -------- Beliebige Position des Footman --------
  17. Set X_Cos_Zwischenergebnis = (X_Koordinate x (Cos(Winkel)))
  18. Set X_Sin_Zwischenergebnis = (X_Koordinate x (Sin(Winkel)))
  19. Set Y_Cos_Zwischenergebnis = (Y_Koordinate x (Cos(Winkel)))
  20. Set Y_Sin_Zwischenergebnis = (Y_Koordinate x (Sin(Winkel)))
  21. -------- Beliebige Position (Anpassung der Koordinaten) --------
  22. Set Neue_X_Koordinate = (X_Cos_Zwischenergebnis - Y_Sin_Zwischenergebnis)
  23. Set Neue_Y_Koordinate = (X_Sin_Zwischenergebnis - Y_Cos_Zwischenergebnis)
  24. -------- Punkt nach der Drehung --------
  25. Set Neuer_Punkt = (Point(Neue_X_Koordinate, Neue_Y_Koordinate))
  26. -------- Die Differenz der Punkte P und Q (Koordinaten) --------
  27. Set Differenz_X = (Neue_X_Koordinate - X_Koordinate_Anfangspunkt)
  28. Set Differenz_Y = (Neue_Y_Koordinate - Y_Koordinate_Anfangspunkt)
  29. -------- Ermittlung der Hypotenuse --------
  30. Set X_Hypotenuse_Zwischenergebnis = (Differenz_X x Differenz_X)
  31. Set Y_Hypotenuse_Zwischenergebnis = (Differenz_Y x Differenz_Y)
  32. Set Hypotenuse = (Square root((X_Hypotenuse_Zwischenergebnis + Y_Hypotenuse_Zwischenergebnis)))
  33. -------- Berechnung --------
  34. If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  35. If - Conditions
  36. ((X_Koordinate Less than X_Koordinate_Anfangspunkt) and (Y_Koordinate Less than Y_Koordinate_Anfangspunkt)) or ((X_Koordinate Greater than X_Koordinate_Anfangspunkt) and (Y_Koordinate Greater than Y_Koordinate_Anfangspunkt))
  37. Then - Actions
  38. -------- Falls -r <= x <= r, dann liegt eine Kollision vor --------
  39. Set X_Drehung_Kosinus = (Differenz_Y / Hypotenuse)
  40. Set X_Drehung_Sinus = (Differenz_X / Hypotenuse)
  41. Set X_Kosinus_Zwischenergebnis = (X_Koordinate x X_Drehung_Kosinus)
  42. Set X_Sinus_Zwischenergebnis = (Y_Koordinate x X_Drehung_Sinus)
  43. Set X_Koordinate_der_Drehung = (X_Kosinus_Zwischenergebnis - X_Sinus_Zwischenergebnis)
  44. Else - Actions
  45. -------- Falls -r <= y <= r, dann liegt eine Kollision vor --------
  46. Set Y_Drehung_Kosinus = (Differenz_X / Hypotenuse)
  47. Set Y_Drehung_Sinus = (Differenz_Y / Hypotenuse)
  48. Set Y_Kosinus_Zwischenergebnis = (X_Koordinate x Y_Drehung_Sinus)
  49. Set Y_Sinus_Zwischenergebnis = (Y_Koordinate x Y_Drehung_Kosinus)
  50. -------- Gemeinsame Schnittpunkte zwischen Kreis und Gerade berechnen --------
  51. -------- Wir berechnen Terme die mehrfach benötigt werden und setzen sie in eine Variable --------
  52. -------- Term: d*c --------
  53. Set X_Koordinate_von_D_und_C = (Differenz_X x (X of Mittelpunkt))
  54. Set Y_Koordinate_von_D_und_C = (Differenz_Y x (Y of Mittelpunkt))
  55. Set Term_D_und_C_zusammengefasst = (X_Koordinate_von_D_und_C + Y_Koordinate_von_D_und_C)
  56. -------- Term: o*d --------
  57. Set X_Koordinate_von_O_und_D = (X_Koordinate x Differenz_X)
  58. Set Y_Koordinate_von_O_und_D = (Y_Koordinate x Differenz_Y)
  59. Set Term_O_und_D_zusammengefasst = (X_Koordinate_von_O_und_D + Y_Koordinate_von_O_und_D)
  60. -------- Term: d^2 --------
  61. Set X_Koordinate_von_D_und_D = (Differenz_X x Differenz_X)
  62. Set Y_Koordinate_von_D_und_D = (Differenz_Y x Differenz_Y)
  63. Set Term_D_und_D_zusammengefasst = (X_Koordinate_von_D_und_D + Y_Koordinate_von_D_und_D)
  64. -------- Term: d*c - o*d --------
  65. Set Term_D_C_O_D = (Term_D_und_C_zusammengefasst - Term_O_und_D_zusammengefasst)
  66. -------- Term: (d*c - o*d) / d^2 --------
  67. Set Term_D_C_O_D_Durch_D2 = (Term_D_C_O_D / Term_D_und_D_zusammengefasst)
  68. -------- Term: [(d*c - o*d) / d^2]^2 --------
  69. Set Term_DCOD_Durch_D2_Quadriert = (Term_D_C_O_D_Durch_D2 x Term_D_C_O_D_Durch_D2)
  70. -------- Term: o-c --------
  71. Set X_Koordinate_von_O_und_C = (X_Koordinate - (X of Mittelpunkt))
  72. Set Y_Koordinate_von_O_und_C = (Y_Koordinate - (Y of Mittelpunkt))
  73. Set X_Koordinate_von_OC_Quadriert = (X_Koordinate_von_O_und_C x X_Koordinate_von_O_und_C)
  74. Set Y_Koordinate_von_OC_Quadriert = (Y_Koordinate_von_O_und_C x Y_Koordinate_von_O_und_C)
  75. Set Term_O_und_C_zusammengefasst = (X_Koordinate_von_OC_Quadriert + Y_Koordinate_von_OC_Quadriert)
  76. -------- Term: r^2 --------
  77. Set Radius_Quadriert = (Radius x Radius)
  78. -------- Term: (o-c)^2 - r^2 --------
  79. Set Term_OC2_R2 = (Term_O_und_C_zusammengefasst - Radius_Quadriert)
  80. -------- Term: ((o-c)^2 - r^2) / d^2 --------
  81. Set Term_OC2_R2_Durch_D2 = (Term_OC2_R2 / Term_D_und_D_zusammengefasst)
  82. -------- Term: Differenz von [(d*c - o*d) / d^2]^2 und ((o-c)^2 - r^2) / d^2 --------
  83. Set Unter_Wurzel_Differenz = (Term_DCOD_Durch_D2_Quadriert - Term_OC2_R2_Durch_D2)
  84. If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  85. If - Conditions
  86. Unter_Wurzel_Differenz Less than 0.00
  87. Then - Actions
  88. Game - Display to (All players) the text: Die Wurzel einer ne...
  89. Else - Actions
  90. -------- Wurzelziehen aus der Differenz --------
  91. Set Unter_Wurzel_Differenz = (Square root(Unter_Wurzel_Differenz))
  92. -------- T1 berechnen aus der Differenz der gezogenen Wurzel und (d*c - o*d) / d^2 --------
  93. Set T1 = (Term_D_C_O_D_Durch_D2 - Unter_Wurzel_Differenz)
  94. -------- T2 berechnen aus der Addition der gezogenen Wurzel und (d*c - o*d) / d^2 --------
  95. Set T2 = (Term_D_C_O_D_Durch_D2 + Unter_Wurzel_Differenz)
  96. Game - Display to (All players) the text: Der Kreis wird ber...
  97. Game - Display to (All players) the text: (Wert für T1: + (String(T1)))
  98. Game - Display to (All players) the text: (Wert für T2: + (String(T2)))
  99. If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  100. If - Conditions
  101. T1 Equal to T2
  102. Then - Actions
  103. Game - Display to (All players) the text: (Es gibt nur einen gemeinsamen Schnittpunkt: + (((String(T1)) + und ) + (String(T2))))
  104. -------- Ortsvektor berechnen: T1 oder T2 * d --------
  105. Set X_T1_und_D_Ortsvektor = (T1 x Differenz_X)
  106. Set Y_T1_und_D_Ortsvektor = (T1 x Differenz_Y)
  107. -------- Addition der Koordinaten --------
  108. Set X_Ortsvektor_O_plus_Produkt_1 = (X_Koordinate + X_T1_und_D_Ortsvektor)
  109. Set Y_Ortsvektor_O_plus_Produkt_1 = (Y_Koordinate + Y_T1_und_D_Ortsvektor)
  110. Set T1_Ortspunkt = (Point(X_Ortsvektor_O_plus_Produkt_1, Y_Ortsvektor_O_plus_Produkt_1))
  111. Unit - Create 1 Shade for Player 1 (Red) at T1_Ortspunkt facing Default building facing degrees
  112. Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
  113. Else - Actions
  114. If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  115. If - Conditions
  116. Unter_Wurzel_Differenz Greater than 0.00
  117. Then - Actions
  118. -------- Ortsvektor berechnen: T1 * d --------
  119. Set X_T1_und_D_Ortsvektor = (T1 x Differenz_X)
  120. Set Y_T1_und_D_Ortsvektor = (T1 x Differenz_Y)
  121. -------- Addition der Koordinaten --------
  122. Set X_Ortsvektor_O_plus_Produkt_1 = (X_Koordinate + X_T1_und_D_Ortsvektor)
  123. Set Y_Ortsvektor_O_plus_Produkt_1 = (Y_Koordinate + Y_T1_und_D_Ortsvektor)
  124. Set T1_Ortspunkt = (Point(X_Ortsvektor_O_plus_Produkt_1, Y_Ortsvektor_O_plus_Produkt_1))
  125. -------- Ortsvektor berechnen: T2 * d --------
  126. Set X_T2_und_D_Ortsvektor = (T2 x Differenz_X)
  127. Set Y_T2_und_D_Ortsvektor = (T2 x Differenz_Y)
  128. -------- Addition der Koordinaten --------
  129. Set X_Ortsvektor_O_plus_Produkt_2 = (X_Koordinate + X_T2_und_D_Ortsvektor)
  130. Set Y_Ortsvektor_O_plus_Produkt_2 = (Y_Koordinate + Y_T2_und_D_Ortsvektor)
  131. Set T2_Ortspunkt = (Point(X_Ortsvektor_O_plus_Produkt_2, Y_Ortsvektor_O_plus_Produkt_2))
  132. Game - Display to (All players) the text: (Die Gerade schneidet den Kreis in zwei Punkten: + (((P1( + ((String(X_Ortsvektor_O_plus_Produkt_1)) + ( | + ((String(Y_Ortsvektor_O_plus_Produkt_1)) + ))))) + und ) + (P2( + ((String(X_Ortsvektor_O_plus_Produkt_2)) + ( | + ((String(Y_Ortsvektor_O_plus_Pr
  133. Unit - Create 1 Shade for Player 1 (Red) at T1_Ortspunkt facing Default building facing degrees
  134. Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
  135. Unit - Create 1 Shade for Player 1 (Red) at T2_Ortspunkt facing Default building facing degrees
  136. Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
  137. -------- Mittelpunkt der Strecke berechnen --------
  138. Set X_Addition_der_Strecke = (X_Ortsvektor_O_plus_Produkt_1 + X_Ortsvektor_O_plus_Produkt_2)
  139. Set Y_Addition_der_Strecke = (Y_Ortsvektor_O_plus_Produkt_1 + Y_Ortsvektor_O_plus_Produkt_2)
  140. Set X_Mittelpunkt_der_Strecke = (X_Addition_der_Strecke / 2.00)
  141. Set Y_Mittelpunkt_der_Strecke = (Y_Addition_der_Strecke / 2.00)
  142. Set Mittelpunkt_der_Strecke = (Point(X_Mittelpunkt_der_Strecke, Y_Mittelpunkt_der_Strecke))
  143. Game - Display to (All players) the text: (Der Mittelpunkt der Strecke lautet: M( + (((String(X_Mittelpunkt_der_Strecke)) + ( | + (String(Y_Mittelpunkt_der_Strecke)))) + )))
  144. Unit - Create 1 Shade for Player 1 (Red) at Mittelpunkt_der_Strecke facing Default building facing degrees
  145. Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
  146. Else - Actions
  147. -------- Abstandsbestimmung zwischen Footman und dem Ortspunkt --------
  148. Set X_Abstand_Subtraktion = (X_Koordinate - X_Ortsvektor_O_plus_Produkt_1)
  149. Set X_Abstand_Quadriert = (X_Abstand_Subtraktion x X_Abstand_Subtraktion)
  150. Set Y_Abstand_Subtraktion = (Y_Koordinate - Y_Ortsvektor_O_plus_Produkt_1)
  151. Set Y_Abstand_Quadriert = (Y_Abstand_Subtraktion x Y_Abstand_Subtraktion)
  152. Set Abstand_Einheit_T1 = (Square root((X_Abstand_Quadriert + Y_Abstand_Quadriert)))
  153. Game - Display to (All players) the text: (Der Abstand der Einheit zu T1 lautet: + (String(Abstand_Einheit_T1)))
  154. -------- Abstandsbestimmung zwischen Paladin und dem Ortspunkt --------
  155. Set X_Abstand_Subtraktion_Paladin = ((X of Mittelpunkt) - X_Ortsvektor_O_plus_Produkt_1)
  156. Set X_Abstand_Quadriert_Paladin = (X_Abstand_Subtraktion_Paladin x X_Abstand_Subtraktion_Paladin)
  157. Set Y_Abstand_Subtraktion_Paladin = ((Y of Mittelpunkt) - Y_Ortsvektor_O_plus_Produkt_1)
  158. Set Y_Abstand_Quadriert_Paladin = (Y_Abstand_Subtraktion_Paladin x Y_Abstand_Subtraktion_Paladin)
  159. Set Abstand_Mittelpunkt_T1 = (Square root((X_Abstand_Quadriert_Paladin + Y_Abstand_Quadriert_Paladin)))
  160. Game - Display to (All players) the text: (Der Abstand des Paladin zu T1 lautet: + (String(Abstand_Mittelpunkt_T1)))
  161. -------- Geschwindigkeit berechnen um eine Kollision hervorzurufen --------
  162. -------- Geschwindigkeit = Weg / Zeit --------
  163. Set Zeit = (Abstand_Einheit_T1 / Geschwindigkeit_der_Einheit)
  164. -------- Geschwindigkeit für das Abwehrprojektil berechnen: --------
  165. Set Geschwindigkeit_Abwehr = (Abstand_Mittelpunkt_T1 / Zeit)
  166. -------- Erstelle Abwehreinheit --------
  167. Unit - Create 1 Shade for Player 1 (Red) at Mittelpunkt facing (Angle from Mittelpunkt to T1_Ortspunkt) degrees
  168. Unit - Set (Last created unit) movement speed to Geschwindigkeit_Abwehr
  169. Unit - Order (Last created unit) to Move To T1_Ortspunkt
  170. Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
  171. Custom script: call RemoveLocation(udg_Mittelpunkt)
  172. Custom script: call RemoveLocation(udg_Anfangspunkt)
  173. Custom script: call RemoveLocation(udg_Schnittpunkt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement