Private Sub cmdCalcResistOHKO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCalcResistOHKO.Click
Dim i As Integer
Dim j As Integer
Dim n As Integer
'Metto il cursore nella posizione di attesa
cmdCalcResistOHKO.Cursor = System.Windows.Forms.Cursors.WaitCursor
'Azzero la somma delle EVs
For i = 0 To 4095
SumEV(i) = 0
ApproveEV(i) = False
MinHPEV(i) = 0
MinDefEV(i) = 0
Next
n = 0 'questo serve per la SumEV
nudFoeHPEV.Value = 0
nudFoeDefEV.Value = 0
'Per gli HP da 0 a 252
For i = 0 To 63
If i <> 0 Then
nudFoeHPEV.Value = nudFoeHPEV.Value + 4
nudFoeDefEV.Value = 0
End If
Calculate_HP()
'Per la Dif da 0 a 252
For j = 0 To 63
If j <> 0 Then
nudFoeDefEV.Value = nudFoeDefEV.Value + 4
End If
Calculate_Defense()
Calculate_Damage()
SumEV(n) = nudFoeHPEV.Value + nudFoeDefEV.Value
MinHPEV(n) = nudFoeHPEV.Value
MinDefEV(n) = nudFoeDefEV.Value
If MaxDmgPerc < 100.0 Then
ApproveEV(n) = True
Else
ApproveEV(n) = False
End If
prbProgress.PerformStep()
n = n + 1
Next
Next
prbProgress.Value = 0
'Ricerca del valore minore dell'array
n = -1
j = 504
For i = 0 To 4095
If ApproveEV(i) = True Then
If SumEV(i) <= j Then
j = SumEV(i)
n = i
End If
End If
Next
'Setta i valori a quello minore, SE non sono -1
If n <> -1 Then
nudFoeHPEV.Value = MinHPEV(n)
nudFoeDefEV.Value = MinDefEV(n)
Calculate_HP()
Calculate_Defense()
Calculate_Damage()
PhraseNeedEV = "- Your Opponent's Pokémon needs " & nudFoeHPEV.Value.ToString & " HP EVs and " & nudFoeDefEV.Value.ToString & " Def EVs in order to resist an OHKO!"
Else
PhraseNeedEV = "- Your Opponent's Pokémon cannot resist this OHKO move!"
End If
Write_Damage()
'Rimetto a posto il cursore
cmdCalcResistOHKO.Cursor = System.Windows.Forms.Cursors.Default
End Sub
Lorb ma che roba è?Lord Bel ha scritto:Codice:Private Sub cmdCalcResistOHKO_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCalcResistOHKO.Click Dim i As Integer Dim j As Integer Dim n As Integer 'Metto il cursore nella posizione di attesa cmdCalcResistOHKO.Cursor = System.Windows.Forms.Cursors.WaitCursor 'Azzero la somma delle EVs For i = 0 To 4095 SumEV(i) = 0 ApproveEV(i) = False MinHPEV(i) = 0 MinDefEV(i) = 0 Next n = 0 'questo serve per la SumEV nudFoeHPEV.Value = 0 nudFoeDefEV.Value = 0 'Per gli HP da 0 a 252 For i = 0 To 63 If i <> 0 Then nudFoeHPEV.Value = nudFoeHPEV.Value + 4 nudFoeDefEV.Value = 0 End If Calculate_HP() 'Per la Dif da 0 a 252 For j = 0 To 63 If j <> 0 Then nudFoeDefEV.Value = nudFoeDefEV.Value + 4 End If Calculate_Defense() Calculate_Damage() SumEV(n) = nudFoeHPEV.Value + nudFoeDefEV.Value MinHPEV(n) = nudFoeHPEV.Value MinDefEV(n) = nudFoeDefEV.Value If MaxDmgPerc < 100.0 Then ApproveEV(n) = True Else ApproveEV(n) = False End If prbProgress.PerformStep() n = n + 1 Next Next prbProgress.Value = 0 'Ricerca del valore minore dell'array n = -1 j = 504 For i = 0 To 4095 If ApproveEV(i) = True Then If SumEV(i) <= j Then j = SumEV(i) n = i End If End If Next 'Setta i valori a quello minore, SE non sono -1 If n <> -1 Then nudFoeHPEV.Value = MinHPEV(n) nudFoeDefEV.Value = MinDefEV(n) Calculate_HP() Calculate_Defense() Calculate_Damage() PhraseNeedEV = "- Your Opponent's Pokémon needs " & nudFoeHPEV. Value.ToString & " HP EVs and " & nudFoeDefEV.Value. ToString & " Def EVs in order to resist an OHKO!" Else PhraseNeedEV = "- Your Opponent's Pokémon cannot resist this OHKO move!" End If Write_Damage() 'Rimetto a posto il cursore cmdCalcResistOHKO.Cursor = System.Windows.Forms.Cursors.Default End Sub
[so che non è passata l'una, ma la notte non posso rispondere in questi giorni in quanto ho internet solo la mattina]E' Visual Basic .NET [o VB.NET], un linguaggio di programmazione per applicazioni Windows.Dark Knight ha scritto:Lorb ma che roba è?
Happy pollution to you! X°DRoCCoH ha scritto:Fanculo a questo topic cattivo. Ho passato un'estate a nottizzare fino alle 4 ed ora che sono sempre impegnaterrimo c'è questo topic infame che ogni volta che lo vedo mi fa "postami postami postami"...
Beh, sono distrutto. Mi vado a stravaccare su un materasso.
Buone polluzioni notturne a tutti.
Beh dai, hai resistito bene finora. ;)RoCCoH ha scritto:Fanculo a questo topic cattivo. Ho passato un'estate a nottizzare fino alle 4 ed ora che sono sempre impegnaterrimo c'è questo topic infame che ogni volta che lo vedo mi fa "postami postami postami"...