Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Variablen
- Events
- Unit - A unit comes within 512.00 of Paladin 0001 <gen>
- Conditions
- (Unit-type of (Triggering unit)) Equal to Footman
- Actions
- Cinematic - Clear the screen of text messages for (All players)
- Set Geschwindigkeit_der_Einheit = (Current movement speed of (Triggering unit))
- Set Winkel = (Facing of (Triggering unit))
- Set Radius = 256.00
- Set Mittelpunkt = (Position of Paladin 0001 <gen>)
- -------- Position des Footman beim eintreten in den Kreis --------
- Set Schnittpunkt = (Position of (Triggering unit))
- Set X_Koordinate = (X of Schnittpunkt)
- Set Y_Koordinate = (Y of Schnittpunkt)
- -------- Beliebige Position des Footman --------
- Set X_Cos_Zwischenergebnis = (X_Koordinate x (Cos(Winkel)))
- Set X_Sin_Zwischenergebnis = (X_Koordinate x (Sin(Winkel)))
- Set Y_Cos_Zwischenergebnis = (Y_Koordinate x (Cos(Winkel)))
- Set Y_Sin_Zwischenergebnis = (Y_Koordinate x (Sin(Winkel)))
- -------- Beliebige Position (Anpassung der Koordinaten) --------
- Set Neue_X_Koordinate = (X_Cos_Zwischenergebnis - Y_Sin_Zwischenergebnis)
- Set Neue_Y_Koordinate = (X_Sin_Zwischenergebnis - Y_Cos_Zwischenergebnis)
- -------- Punkt nach der Drehung --------
- Set Neuer_Punkt = (Point(Neue_X_Koordinate, Neue_Y_Koordinate))
- -------- Die Differenz der Punkte P und Q (Koordinaten) --------
- Set Differenz_X = (Neue_X_Koordinate - X_Koordinate_Anfangspunkt)
- Set Differenz_Y = (Neue_Y_Koordinate - Y_Koordinate_Anfangspunkt)
- -------- Ermittlung der Hypotenuse --------
- Set X_Hypotenuse_Zwischenergebnis = (Differenz_X x Differenz_X)
- Set Y_Hypotenuse_Zwischenergebnis = (Differenz_Y x Differenz_Y)
- Set Hypotenuse = (Square root((X_Hypotenuse_Zwischenergebnis + Y_Hypotenuse_Zwischenergebnis)))
- -------- Berechnung --------
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((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))
- Then - Actions
- -------- Falls -r <= x <= r, dann liegt eine Kollision vor --------
- Set X_Drehung_Kosinus = (Differenz_Y / Hypotenuse)
- Set X_Drehung_Sinus = (Differenz_X / Hypotenuse)
- Set X_Kosinus_Zwischenergebnis = (X_Koordinate x X_Drehung_Kosinus)
- Set X_Sinus_Zwischenergebnis = (Y_Koordinate x X_Drehung_Sinus)
- Set X_Koordinate_der_Drehung = (X_Kosinus_Zwischenergebnis - X_Sinus_Zwischenergebnis)
- Else - Actions
- -------- Falls -r <= y <= r, dann liegt eine Kollision vor --------
- Set Y_Drehung_Kosinus = (Differenz_X / Hypotenuse)
- Set Y_Drehung_Sinus = (Differenz_Y / Hypotenuse)
- Set Y_Kosinus_Zwischenergebnis = (X_Koordinate x Y_Drehung_Sinus)
- Set Y_Sinus_Zwischenergebnis = (Y_Koordinate x Y_Drehung_Kosinus)
- -------- Gemeinsame Schnittpunkte zwischen Kreis und Gerade berechnen --------
- -------- Wir berechnen Terme die mehrfach benötigt werden und setzen sie in eine Variable --------
- -------- Term: d*c --------
- Set X_Koordinate_von_D_und_C = (Differenz_X x (X of Mittelpunkt))
- Set Y_Koordinate_von_D_und_C = (Differenz_Y x (Y of Mittelpunkt))
- Set Term_D_und_C_zusammengefasst = (X_Koordinate_von_D_und_C + Y_Koordinate_von_D_und_C)
- -------- Term: o*d --------
- Set X_Koordinate_von_O_und_D = (X_Koordinate x Differenz_X)
- Set Y_Koordinate_von_O_und_D = (Y_Koordinate x Differenz_Y)
- Set Term_O_und_D_zusammengefasst = (X_Koordinate_von_O_und_D + Y_Koordinate_von_O_und_D)
- -------- Term: d^2 --------
- Set X_Koordinate_von_D_und_D = (Differenz_X x Differenz_X)
- Set Y_Koordinate_von_D_und_D = (Differenz_Y x Differenz_Y)
- Set Term_D_und_D_zusammengefasst = (X_Koordinate_von_D_und_D + Y_Koordinate_von_D_und_D)
- -------- Term: d*c - o*d --------
- Set Term_D_C_O_D = (Term_D_und_C_zusammengefasst - Term_O_und_D_zusammengefasst)
- -------- Term: (d*c - o*d) / d^2 --------
- Set Term_D_C_O_D_Durch_D2 = (Term_D_C_O_D / Term_D_und_D_zusammengefasst)
- -------- Term: [(d*c - o*d) / d^2]^2 --------
- Set Term_DCOD_Durch_D2_Quadriert = (Term_D_C_O_D_Durch_D2 x Term_D_C_O_D_Durch_D2)
- -------- Term: o-c --------
- Set X_Koordinate_von_O_und_C = (X_Koordinate - (X of Mittelpunkt))
- Set Y_Koordinate_von_O_und_C = (Y_Koordinate - (Y of Mittelpunkt))
- Set X_Koordinate_von_OC_Quadriert = (X_Koordinate_von_O_und_C x X_Koordinate_von_O_und_C)
- Set Y_Koordinate_von_OC_Quadriert = (Y_Koordinate_von_O_und_C x Y_Koordinate_von_O_und_C)
- Set Term_O_und_C_zusammengefasst = (X_Koordinate_von_OC_Quadriert + Y_Koordinate_von_OC_Quadriert)
- -------- Term: r^2 --------
- Set Radius_Quadriert = (Radius x Radius)
- -------- Term: (o-c)^2 - r^2 --------
- Set Term_OC2_R2 = (Term_O_und_C_zusammengefasst - Radius_Quadriert)
- -------- Term: ((o-c)^2 - r^2) / d^2 --------
- Set Term_OC2_R2_Durch_D2 = (Term_OC2_R2 / Term_D_und_D_zusammengefasst)
- -------- Term: Differenz von [(d*c - o*d) / d^2]^2 und ((o-c)^2 - r^2) / d^2 --------
- Set Unter_Wurzel_Differenz = (Term_DCOD_Durch_D2_Quadriert - Term_OC2_R2_Durch_D2)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Unter_Wurzel_Differenz Less than 0.00
- Then - Actions
- Game - Display to (All players) the text: Die Wurzel einer ne...
- Else - Actions
- -------- Wurzelziehen aus der Differenz --------
- Set Unter_Wurzel_Differenz = (Square root(Unter_Wurzel_Differenz))
- -------- T1 berechnen aus der Differenz der gezogenen Wurzel und (d*c - o*d) / d^2 --------
- Set T1 = (Term_D_C_O_D_Durch_D2 - Unter_Wurzel_Differenz)
- -------- T2 berechnen aus der Addition der gezogenen Wurzel und (d*c - o*d) / d^2 --------
- Set T2 = (Term_D_C_O_D_Durch_D2 + Unter_Wurzel_Differenz)
- Game - Display to (All players) the text: Der Kreis wird ber...
- Game - Display to (All players) the text: (Wert für T1: + (String(T1)))
- Game - Display to (All players) the text: (Wert für T2: + (String(T2)))
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- T1 Equal to T2
- Then - Actions
- Game - Display to (All players) the text: (Es gibt nur einen gemeinsamen Schnittpunkt: + (((String(T1)) + und ) + (String(T2))))
- -------- Ortsvektor berechnen: T1 oder T2 * d --------
- Set X_T1_und_D_Ortsvektor = (T1 x Differenz_X)
- Set Y_T1_und_D_Ortsvektor = (T1 x Differenz_Y)
- -------- Addition der Koordinaten --------
- Set X_Ortsvektor_O_plus_Produkt_1 = (X_Koordinate + X_T1_und_D_Ortsvektor)
- Set Y_Ortsvektor_O_plus_Produkt_1 = (Y_Koordinate + Y_T1_und_D_Ortsvektor)
- Set T1_Ortspunkt = (Point(X_Ortsvektor_O_plus_Produkt_1, Y_Ortsvektor_O_plus_Produkt_1))
- Unit - Create 1 Shade for Player 1 (Red) at T1_Ortspunkt facing Default building facing degrees
- Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
- Else - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Unter_Wurzel_Differenz Greater than 0.00
- Then - Actions
- -------- Ortsvektor berechnen: T1 * d --------
- Set X_T1_und_D_Ortsvektor = (T1 x Differenz_X)
- Set Y_T1_und_D_Ortsvektor = (T1 x Differenz_Y)
- -------- Addition der Koordinaten --------
- Set X_Ortsvektor_O_plus_Produkt_1 = (X_Koordinate + X_T1_und_D_Ortsvektor)
- Set Y_Ortsvektor_O_plus_Produkt_1 = (Y_Koordinate + Y_T1_und_D_Ortsvektor)
- Set T1_Ortspunkt = (Point(X_Ortsvektor_O_plus_Produkt_1, Y_Ortsvektor_O_plus_Produkt_1))
- -------- Ortsvektor berechnen: T2 * d --------
- Set X_T2_und_D_Ortsvektor = (T2 x Differenz_X)
- Set Y_T2_und_D_Ortsvektor = (T2 x Differenz_Y)
- -------- Addition der Koordinaten --------
- Set X_Ortsvektor_O_plus_Produkt_2 = (X_Koordinate + X_T2_und_D_Ortsvektor)
- Set Y_Ortsvektor_O_plus_Produkt_2 = (Y_Koordinate + Y_T2_und_D_Ortsvektor)
- Set T2_Ortspunkt = (Point(X_Ortsvektor_O_plus_Produkt_2, Y_Ortsvektor_O_plus_Produkt_2))
- 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
- Unit - Create 1 Shade for Player 1 (Red) at T1_Ortspunkt facing Default building facing degrees
- Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
- Unit - Create 1 Shade for Player 1 (Red) at T2_Ortspunkt facing Default building facing degrees
- Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
- -------- Mittelpunkt der Strecke berechnen --------
- Set X_Addition_der_Strecke = (X_Ortsvektor_O_plus_Produkt_1 + X_Ortsvektor_O_plus_Produkt_2)
- Set Y_Addition_der_Strecke = (Y_Ortsvektor_O_plus_Produkt_1 + Y_Ortsvektor_O_plus_Produkt_2)
- Set X_Mittelpunkt_der_Strecke = (X_Addition_der_Strecke / 2.00)
- Set Y_Mittelpunkt_der_Strecke = (Y_Addition_der_Strecke / 2.00)
- Set Mittelpunkt_der_Strecke = (Point(X_Mittelpunkt_der_Strecke, Y_Mittelpunkt_der_Strecke))
- Game - Display to (All players) the text: (Der Mittelpunkt der Strecke lautet: M( + (((String(X_Mittelpunkt_der_Strecke)) + ( | + (String(Y_Mittelpunkt_der_Strecke)))) + )))
- Unit - Create 1 Shade for Player 1 (Red) at Mittelpunkt_der_Strecke facing Default building facing degrees
- Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
- Else - Actions
- -------- Abstandsbestimmung zwischen Footman und dem Ortspunkt --------
- Set X_Abstand_Subtraktion = (X_Koordinate - X_Ortsvektor_O_plus_Produkt_1)
- Set X_Abstand_Quadriert = (X_Abstand_Subtraktion x X_Abstand_Subtraktion)
- Set Y_Abstand_Subtraktion = (Y_Koordinate - Y_Ortsvektor_O_plus_Produkt_1)
- Set Y_Abstand_Quadriert = (Y_Abstand_Subtraktion x Y_Abstand_Subtraktion)
- Set Abstand_Einheit_T1 = (Square root((X_Abstand_Quadriert + Y_Abstand_Quadriert)))
- Game - Display to (All players) the text: (Der Abstand der Einheit zu T1 lautet: + (String(Abstand_Einheit_T1)))
- -------- Abstandsbestimmung zwischen Paladin und dem Ortspunkt --------
- Set X_Abstand_Subtraktion_Paladin = ((X of Mittelpunkt) - X_Ortsvektor_O_plus_Produkt_1)
- Set X_Abstand_Quadriert_Paladin = (X_Abstand_Subtraktion_Paladin x X_Abstand_Subtraktion_Paladin)
- Set Y_Abstand_Subtraktion_Paladin = ((Y of Mittelpunkt) - Y_Ortsvektor_O_plus_Produkt_1)
- Set Y_Abstand_Quadriert_Paladin = (Y_Abstand_Subtraktion_Paladin x Y_Abstand_Subtraktion_Paladin)
- Set Abstand_Mittelpunkt_T1 = (Square root((X_Abstand_Quadriert_Paladin + Y_Abstand_Quadriert_Paladin)))
- Game - Display to (All players) the text: (Der Abstand des Paladin zu T1 lautet: + (String(Abstand_Mittelpunkt_T1)))
- -------- Geschwindigkeit berechnen um eine Kollision hervorzurufen --------
- -------- Geschwindigkeit = Weg / Zeit --------
- Set Zeit = (Abstand_Einheit_T1 / Geschwindigkeit_der_Einheit)
- -------- Geschwindigkeit für das Abwehrprojektil berechnen: --------
- Set Geschwindigkeit_Abwehr = (Abstand_Mittelpunkt_T1 / Zeit)
- -------- Erstelle Abwehreinheit --------
- Unit - Create 1 Shade for Player 1 (Red) at Mittelpunkt facing (Angle from Mittelpunkt to T1_Ortspunkt) degrees
- Unit - Set (Last created unit) movement speed to Geschwindigkeit_Abwehr
- Unit - Order (Last created unit) to Move To T1_Ortspunkt
- Unit - Add a 4.00 second Generic expiration timer to (Last created unit)
- Custom script: call RemoveLocation(udg_Mittelpunkt)
- Custom script: call RemoveLocation(udg_Anfangspunkt)
- Custom script: call RemoveLocation(udg_Schnittpunkt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement