For i = 1 To ArgNum
Array ARY Args(i) "="
Switch ARY[1]
Case 画像ファイル
Set Pict[A] ARY[2]
Set Pict[B] ARY[3]
Case 画像サイズ
Set PictSz[A] ARY[2]
Set PictSz[B] ARY[3]
Case 色
Skip
Case Else
If InStr(ARY[1], ".wav") > 0 Then
Set PrSE ARY[1]
EndIf
EndSw
Next
Local i T_X T_Y ANG DRCT W_P W_S H_C S_E S-I C-S LN
Local UID = _GetName(対象ユニットID,_GetIDFromArgs())
_CenteringCheck UID
Set T_X (WX(UID) + 16)
Set T_Y (WY(UID) + 16)
# +16してユニット画像の中心座標を得ておく。
Set ANG Call(_GetAngle)
Set DRCT _FlipVertical(ANG)
# 目標までの角度と上下反転するかどうかの取得。汎用戦闘アニメ流用。
Set W_P[1] Args(1)
Set W_S[1] Args(2)
Set W_P[2] Args(3)
Set W_S[2] Args(4)
Set S_E _GetName(Reload.wav,Args(5))
Local i m T_X T_Y ANG DRCT W_P W_S B_C B_S H_C S-I C-S LN ARY
Local UID = _GetName(対象ユニットID,_GetIDFromArgs())
_CenteringCheck UID
Set T_X (WX(UID) + 16)
Set T_Y (WY(UID) + 16)
Set ANG Call(_GetAngle)
Set DRCT _FlipVertical(ANG)
Set B_S Call(_GetSizeFromArgs)
For i = 1 To ArgNum
Array ARY Args(i) "="
Switch ARY[1]
Case 画像ファイル
Set W_P[A] ARY[2]
Set W_P[B] ARY[3]
Case 画像サイズ
Set W_S[A] ARY[2]
Set W_S[B] ARY[3]
Case 色
Set B_C[A] ARY[2]
Set B_C[B] ARY[3]
Case Else
Skip
EndSw
Next
Set W_P[1] _GetName("Weapon\EFFECT_BeamRifle01.bmp",W_P[A])
Set W_S[1] _GetName(32,W_S[A])
Set W_P[2] _GetName("Weapon\EFFECT_BeamRifle01.bmp",W_P[B])
Set W_S[2] _GetName(32,W_S[B])
If B_S = "小" Then
Set B_C[1] ("Beam\EFFECT_Beam" & _GetName("(Pink)",_G_BC_FA(B_C[A])) & "0")
Set B_C[2] ("Beam\EFFECT_Beam" & _GetName("(Pink)",_G_BC_FA(B_C[B])) & "0")
ElseIf B_S = "中" Then
Set B_C[1] ("Beam\EFFECT_MBeam" & _GetName("(Pink)",_G_BC_FA(B_C[A])) & "0")
Set B_C[2] ("Beam\EFFECT_MBeam" & _GetName("(Pink)",_G_BC_FA(B_C[B])) & "0")
EndIf
Set H_C[1] (W_S[1] / 2)
Set H_C[2] (W_S[2] / 2)
# 修正値の計算……画像サイズの半分=画像回転時の半径
Set S-I[1] (Sin(3.141592 * ANG / 180) * H_C[1])
Set S-I[2] (Sin(3.141592 * ANG / 180) * H_C[2])
Set C-S[1] (Cos(3.141592 * ANG / 180) * H_C[1])
Set C-S[2] (Cos(3.141592 * ANG / 180) * H_C[2])
# 画像の半径にそれぞれの角度のサイン・コサインをかける
# =画像回転時の砲口の位置を知るための修正値
Set LN[X] _GetCircumference(ANG,X)
Set LN[Y] _GetCircumference(ANG,Y)
# ビーム発射時の”反動”=ビーム発射方向の逆ベクトルを求める。汎用戦闘アニメ流用。
_UnSetBattleAnimeValue
# ↓ここから画像の表示
Wait Start
PlaySound Charge.wav
For i = 1 To 5
ClearPicture
Switch i
Case 3
_SelectSound Beam.wav _GetWavFromArgs()
If B_S = "小" Then
Set m -2
ElseIf B_S = "中" Then
Set m -4
EndIf
Case 4
If B_S = "小" Then
Set m -1
ElseIf B_S = "中" Then
Set m -2
EndIf
Case Else
Set m 0
EndSw
PaintPicture W_P[1] (T_X - H_C[1] - C-S[A] + (LN[X] * m)) (T_Y - H_C[1] - S-I[A] + (LN[Y] * m)) W_S[1] W_S[1] 透過 DRCT 右回転 ANG _ColorTime()
PaintPicture W_P[2] (T_X - H_C[2] + C-S[A] + (LN[X] * m)) (T_Y - H_C[2] + S-I[A] + (LN[Y] * m)) W_S[2] W_S[2] 透過 DRCT 右回転 ANG _ColorTime()
PaintPicture (B_C[1] & i & ".bmp") (T_X - 32 - C-S[A] - C-S[1]) (T_Y - 32 - S-I[A] - S-I[1]) 64 64 透過 右回転 ANG _ColorTime(1)
PaintPicture (B_C[2] & i & ".bmp") (T_X - 32 + C-S[A] - C-S[2]) (T_Y - 32 + S-I[A] - S-I[2]) 64 64 透過 右回転 ANG _ColorTime(1)
Refresh
Wait Until (0.8 * i)
Next
UnSet i m T_X T_Y ANG W_P W_S B_C B_S H_C S-I C-S S_E LN ARY PrSE
Return
Local i m E_X E_Y ANG B_C B_CA B_CB X_F Y_F ARY B_S P_S
Local UID = _GetName(相手ユニットID,_GetIDFromArgs())
_CenteringCheck UID
Set E_X (WX(UID) - 16)
Set E_Y (WY(UID) - 16)
Set ANG Call(_GetAngle)
Set B_S Call(_GetSizeFromArgs)
For i = 1 To ArgNum
Array ARY Args(i) "="
Switch ARY[1]
Case 画像ファイル 画像サイズ
Skip
Case 色
Set B_C[A] ARY[2]
Set B_C[B] ARY[3]
Case Else
Skip
EndSw
Next
Set B_CA[1] ("Beam\EFFECT_BeamDroplet" & _GetName("(Pink)",_G_BC_FA(B_C[A])) & "0")
Set B_CA[2] ("Beam\EFFECT_BeamDroplet" & _GetName("(Pink)",_G_BC_FA(B_C[B])) & "0")
If B_S = "小" Then
Set B_CB[1] ("Beam\EFFECT_BeamHit" & _GetName("(Pink)",_G_BC_FA(B_C[A])) & "0")
Set B_CB[2] ("Beam\EFFECT_BeamHit" & _GetName("(Pink)",_G_BC_FA(B_C[B])) & "0")
Set m 1
Set P_S[1] 26
Set P_S[2] 24
ElseIf B_S = "中" Then
Set B_CB[1] ("Beam\EFFECT_MBeamHit" & _GetName("(Pink)",_G_BC_FA(B_C[A])) & "0")
Set B_CB[2] ("Beam\EFFECT_MBeamHit" & _GetName("(Pink)",_G_BC_FA(B_C[B])) & "0")
Set m 2
Set P_S[1] 20
Set P_S[2] 16
EndIf
Set X_F _GetCircumference((ANG + 90),X)
Set Y_F _GetCircumference((ANG + 90),Y)
Wait Start
For i = 1 To 6
ClearPicture
If (i = 2) Then
_SelectSound Explode.wav _GetWavFromArgs()
EndIf
Switch i
Case 2
PaintPicture (B_CA[1] & 1 & ".bmp") (E_X + P_S[1] + (X_F * 8)) (E_Y + P_S[1] + (Y_F * 8)) (12 * m) (12 * m) 右回転 ANG 透過 _ColorTime(1)
PaintPicture (B_CA[2] & 1 & ".bmp") (E_X + P_S[1] + (X_F * -8)) (E_Y + P_S[1] + (Y_F * -8)) (12 * m) (12 * m) 右回転 ANG 透過 _ColorTime(1)
Case 3 4
PaintPicture (B_CA[1] & 1 & ".bmp") (E_X + P_S[2] + (X_F * 8)) (E_Y + P_S[2] + (Y_F * 8)) (16 * m) (16 * m) 右回転 ANG 透過 _ColorTime(1)
PaintPicture (B_CA[2] & 1 & ".bmp") (E_X + P_S[2] + (X_F * -8)) (E_Y + P_S[2] + (Y_F * -8)) (16 * m) (16 * m) 右回転 ANG 透過 _ColorTime(1)
EndSw
PaintPicture (B_CB[1] & i & ".bmp") (E_X + (X_F * 8)) (E_Y + (Y_F * 8)) 64 64 透過 右回転 ANG _ColorTime(1)
PaintPicture (B_CB[2] & i & ".bmp") (E_X + (X_F * -8)) (E_Y + (Y_F * -8)) 64 64 透過 右回転 ANG _ColorTime(1)
Refresh
Wait Until (0.7 * i)
Next
UnSet i m E_X E_Y ANG B_C B_CA B_CB X_F Y_F ARY B_S P_S
Return
# ローカル変数を削除してリターン
戦闘アニメ_G00_左右別武器突撃攻撃:
Local i C_X C_Y W_X W_Y ANG DRCT DRCT2 W_P W_S H_C S-I C-S LN
Local UID = _GetName(対象ユニットID,_GetIDFromArgs())
_CenteringCheck UID
Set C_X WX(UID)
Set C_Y WY(UID)
Set ANG Call(_GetAngle)
If (X(UID) >= _Get_X(相手ユニットID)) Then
Set DRCT ""
Else
Set DRCT 左右反転
EndIf
Set DRCT2 _FlipVertical(ANG)
For i = 1 To ArgNum
Array ARY Args(i) "="
Switch ARY[1]
Case 画像ファイル
Set W_P[1] ARY[2]
Set W_P[2] ARY[3]
Case 画像サイズ
Set W_S[1] ARY[2]
Set W_S[2] ARY[3]
Case Else
Skip
EndSw
Next
Set H_C[1] (W_S[1] / 2)
Set H_C[2] (W_S[2] / 2)
Set S-I[A] (Sin(3.141592 * (ANG + 90) / 180) * 16)
Set C-S[A] (Cos(3.141592 * (ANG + 90) / 180) * 16)
# 画像表示用・修正値の計算など
Local X_F = _GetCircumference(ANG,X)
Local Y_F = _GetCircumference(ANG,Y)
Local BMP_FILE = _GetBMPName(UID)
Local BMP_FILE2 = _GetTileName(UID)
_UnSetBattleAnimeValue
Set W_X[1] ((C_X + 16) - H_C[1] - C-S[A])
Set W_Y[1] ((C_Y + 16) - H_C[1] - S-I[A])
Set W_X[2] ((C_X + 16) - H_C[2] + C-S[A])
Set W_Y[2] ((C_Y + 16) - H_C[2] + S-I[A])
Local i m T_X T_Y ANG DRCT W_P W_S B_F B_S B_C H_C S-I C-S X_F Y_F ARY
Local UID = _GetName(対象ユニットID,_GetIDFromArgs())
_CenteringCheck UID
Set T_X (WX(UID) + 16)
Set T_Y (WY(UID) + 16)
Set ANG Call(_GetAngle)
Set DRCT _FlipVertical(ANG)
Set B_S Call(_GetSizeFromArgs)
Set B_C _GetName("(Pink)",_GetBeamColorFromArgs())
Set W_P _GetName(Weapon\EFFECT_BeamRifle01.bmp,_GetBMPFromArgs())
Set W_S _GetName(32,_GetNumberFromArgs())
If B_S = "小" Then
Set B_F ("Beam\EFFECT_Beam" & B_C & "0")
ElseIf B_S = "中" Then
Set B_F ("Beam\EFFECT_MBeam" & B_C & "0")
EndIf
Set H_C (W_S / 2)
# 修正値の計算……画像サイズの半分=画像回転時の半径
Set S-I[A] (Sin(3.141592 * ANG / 180) * 20)
Set C-S[A] (Cos(3.141592 * ANG / 180) * 20)
# ビームの発射位置修正値
#
# EFFECT_G00_GNHolsterBits(F).bmpを開いたところ、穴と穴の間隔は20前後だったので半径20の円と仮定。
# それぞれサインとコサインを求めています。
# 二丁ビームライフルと違い、砲口が一直線上に並んでいるため、角度(ANG)に修正値を足す必要がありません。
# あとは、ここで得た値をプラスにするかマイナスにするか(真ん中の砲口では何もしない)だけです。
Set X_F _GetCircumference(ANG,X)
Set Y_F _GetCircumference(ANG,Y)
# ビーム発射時の”反動”=ビーム発射方向の逆ベクトルを求める。
_UnSetBattleAnimeValue
# ↓ここから画像の表示
Wait Start
PlaySound Charge.wav
For i = 1 To 5
ClearPicture
Switch i
Case 3
_SelectSound Beam.wav _GetWavFromArgs()
If B_S = "小" Then
Set m -2
ElseIf B_S = "中" Then
Set m -4
EndIf
Case 4
If B_S = "小" Then
Set m -1
ElseIf B_S = "中" Then
Set m -2
EndIf
Case Else
Set m 0
EndSw
PaintPicture W_P (T_X - H_C + (X_F * m)) (T_Y - H_C + (Y_F * m)) W_S W_S 透過 DRCT 右回転 ANG _ColorTime()
PaintPicture (B_F & i & ".bmp") (T_X - 32 - C-S[A]) (T_Y - 32 - S-I[A]) 64 64 透過 右回転 ANG _ColorTime(1)
PaintPicture (B_F & i & ".bmp") (T_X - 32) (T_Y - 32) 64 64 透過 右回転 ANG _ColorTime(1)
PaintPicture (B_F & i & ".bmp") (T_X - 32 + C-S[A]) (T_Y - 32 + S-I[A]) 64 64 透過 右回転 ANG _ColorTime(1)
Refresh
Wait Until (0.8 * i)
Next
Local i m E_X E_Y ANG B_C B_CA B_F ARY P_S
Local UID = _GetName(相手ユニットID,_GetIDFromArgs())
_CenteringCheck UID
Set E_X (WX(UID) - 16)
Set E_Y (WY(UID) - 16)
Set ANG Call(_GetAngle)
Set B_S Call(_GetSizeFromArgs)
Set B_CA ("Beam\EFFECT_BeamDroplet" & _GetName("(Pink)",_GetBeamColorFromArgs()) & "0")
If B_S = "小" Then
Set B_F ("Beam\EFFECT_BeamHit" & _GetName("(Pink)",_GetBeamColorFromArgs()) & "0")
Set m 1
Set P_S[1] 26
Set P_S[2] 24
ElseIf B_S = "中" Then
Set B_F ("Beam\EFFECT_MBeamHit" & _GetName("(Pink)",_GetBeamColorFromArgs()) & "0")
Set m 2
Set P_S[1] 20
Set P_S[2] 16
EndIf
Set S-I[A] (Sin(3.141592 * ANG / 180) * 20)
Set C-S[A] (Cos(3.141592 * ANG / 180) * 20)
Wait Start
For i = 1 To 6
ClearPicture
If (i = 2) Then
_SelectSound Explode.wav _GetWavFromArgs()
EndIf
Switch i
Case 2
PaintPicture (B_CA & 1 & ".bmp") (E_X + P_S[1] - C-S[A]) (E_Y + P_S[1] - S-I[A]) (12 * m) (12 * m) 右回転 ANG 透過 _ColorTime(1)
PaintPicture (B_CA & 1 & ".bmp") (E_X + P_S[1]) (E_Y + P_S[1]) (12 * m) (12 * m) 右回転 ANG 透過 _ColorTime(1)
PaintPicture (B_CA & 1 & ".bmp") (E_X + P_S[1] + C-S[A]) (E_Y + P_S[1] + S-I[A]) (12 * m) (12 * m) 右回転 ANG 透過 _ColorTime(1)
Case 3 4
PaintPicture (B_CA & 1 & ".bmp") (E_X + P_S[2] - C-S[A]) (E_Y + P_S[2] - S-I[A]) (16 * m) (16 * m) 右回転 ANG 透過 _ColorTime(1)
PaintPicture (B_CA & 1 & ".bmp") (E_X + P_S[2]) (E_Y + P_S[2]) (16 * m) (16 * m) 右回転 ANG 透過 _ColorTime(1)
PaintPicture (B_CA & 1 & ".bmp") (E_X + P_S[2] + C-S[A]) (E_Y + P_S[2] + S-I[A]) (16 * m) (16 * m) 右回転 ANG 透過 _ColorTime(1)
EndSw
PaintPicture (B_F & i & ".bmp") (E_X - C-S[A]) (E_Y - S-I[A]) 64 64 透過 右回転 ANG _ColorTime(1)
PaintPicture (B_F & i & ".bmp") E_X E_Y 64 64 透過 右回転 ANG _ColorTime(1)
PaintPicture (B_F & i & ".bmp") (E_X + C-S[A]) (E_Y + S-I[A]) 64 64 透過 右回転 ANG _ColorTime(1)
Refresh
Wait Until (0.7 * i)