Skip to content

Commit b3e46f2

Browse files
"Arthas se distrae"
1 parent 817f2dd commit b3e46f2

File tree

1 file changed

+31
-29
lines changed

1 file changed

+31
-29
lines changed

01-AtaquesFantasticos/AtaquesFantasticosPaso2.st

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ DenotativeObject subclass: #CombatienteHumanoArthas
99

1010
!classDefinition: 'CombatienteHumanoArthas class' category: 'AtaquesFantasticosPaso2'!
1111
CombatienteHumanoArthas class
12-
instanceVariableNames: 'puntosDeFuerza puntosDeAgilidad estrategia dañoAAbsorber dañoAInfligir puntosDeVida enemigos fueraDeCombate'!
12+
instanceVariableNames: 'puntosDeFuerza puntosDeAgilidad estrategia dañoAAbsorber dañoAInfligir puntosDeVida enemigos fueraDeCombate estaDistraido'!
1313

1414
!CombatienteHumanoArthas class methodsFor: 'combate' stamp: 'MP 9/18/2022 19:57:39'!
1515
atacar
@@ -51,7 +51,7 @@ focalizarEnElMasSano
5151
noEstaHerido
5252
^puntosDeVida = (20*pv).! !
5353

54-
!CombatienteHumanoArthas class methodsFor: 'combate' stamp: 'MP 9/17/2022 15:24:39'!
54+
!CombatienteHumanoArthas class methodsFor: 'combate' stamp: 'MP 9/20/2022 14:47:53'!
5555
prepararseParaElCombate
5656
puntosDeVida := 20*pv.
5757
dañoAInfligir := 2*pv.
@@ -60,17 +60,20 @@ prepararseParaElCombate
6060
estrategia := [:posiblesEnemigosAAtacar | posiblesEnemigosAAtacar anyOne ].
6161
puntosDeAgilidad := 1*pv.
6262
puntosDeFuerza := 0*pv.
63-
fueraDeCombate := false.! !
63+
fueraDeCombate := false.
64+
estaDistraido := false.! !
6465

6566
!CombatienteHumanoArthas class methodsFor: 'combate' stamp: 'pal 8/23/2022 23:49:24'!
6667
puntosDeVida
6768
^puntosDeVida! !
6869

69-
!CombatienteHumanoArthas class methodsFor: 'combate' stamp: 'MP 9/17/2022 15:25:24'!
70+
!CombatienteHumanoArthas class methodsFor: 'combate' stamp: 'MP 9/20/2022 14:49:45'!
7071
recibirDaño: unaCantidadDeDaño
71-
| dañoADescontar |
72-
dañoADescontar := (unaCantidadDeDaño - dañoAAbsorber - puntosDeAgilidad) max: 0*pv.
72+
| dañoADescontar|
73+
dañoADescontar := (unaCantidadDeDaño - dañoAAbsorber - puntosDeAgilidad) max: (0*pv).
74+
estaDistraido ifTrue: [dañoADescontar = 0 ifFalse: [puntosDeVida := puntosDeVida - (2*pv)]].
7375
puntosDeVida := puntosDeVida - dañoADescontar.
76+
dañoADescontar = 0 ifTrue: [estaDistraido := true] ifFalse: [estaDistraido := false].
7477
self chequearFueraDeCombate.
7578
! !
7679

@@ -96,20 +99,21 @@ usarHacha
9699
dañoAInfligir := 10*pv.! !
97100

98101

99-
!CombatienteHumanoArthas class methodsFor: '--** private fileout/in **--' stamp: 'MP 9/18/2022 21:48:30'!
102+
!CombatienteHumanoArthas class methodsFor: '--** private fileout/in **--' stamp: 'MP 9/20/2022 14:54:06'!
100103
initializeCollaboratorsFromFile
101104
"Auto generated method for loading purposes - Do not modify it"
102105

103106
puntosDeFuerza := (SimpleMeasure basicNew instVarAt: 1 put: 0; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
104107
puntosDeAgilidad := (SimpleMeasure basicNew instVarAt: 1 put: 1; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
105-
estrategia := ((SerializableBlockClosure basicNew instVarAt: 1 put: (SerializableBlockClosure basicNew instVarAt: 1 put: CombatienteHumanoArthas; instVarAt: 2 put: '[ :argm4_1 |
106-
argm4_1 anyOne. ]'; instVarAt: 3 put: #(); yourself); instVarAt: 2 put: '[ :argm0_1 |
107-
argm0_1 anyOne. ]'; instVarAt: 3 put: #(); yourself) asEvaluable).
108-
dañoAAbsorber := (SimpleMeasure basicNew instVarAt: 1 put: 0; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
108+
estrategia := ((SerializableBlockClosure basicNew instVarAt: 1 put: CombatienteHumanoArthas; instVarAt: 2 put: '[ :argm0_1 |
109+
argm0_1 detectMin: [ :argm0_2 |
110+
argm0_2 puntosDeVida ]. ]'; instVarAt: 3 put: #(); yourself) asEvaluable).
111+
dañoAAbsorber := (SimpleMeasure basicNew instVarAt: 1 put: 6; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
109112
dañoAInfligir := (SimpleMeasure basicNew instVarAt: 1 put: 2; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
110-
puntosDeVida := (SimpleMeasure basicNew instVarAt: 1 put: 2; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
111-
enemigos := ((Array new: 1) at: 1 put: CombatienteOrcoOlgra; yourself).
112-
fueraDeCombate := false.! !
113+
puntosDeVida := (SimpleMeasure basicNew instVarAt: 1 put: 20; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
114+
enemigos := ((Array new: 2) at: 1 put: CombatienteOrcoOlgra; at: 2 put: CombatienteOrcoMankrik; yourself).
115+
fueraDeCombate := false.
116+
estaDistraido := true.! !
113117

114118

115119
!classDefinition: #CombatienteOrcoMankrik category: 'AtaquesFantasticosPaso2'!
@@ -213,18 +217,17 @@ usarHacha
213217
dañoAInfligir := 10*pv.! !
214218

215219

216-
!CombatienteOrcoMankrik class methodsFor: '--** private fileout/in **--' stamp: 'MP 9/18/2022 21:48:30'!
220+
!CombatienteOrcoMankrik class methodsFor: '--** private fileout/in **--' stamp: 'MP 9/20/2022 14:54:06'!
217221
initializeCollaboratorsFromFile
218222
"Auto generated method for loading purposes - Do not modify it"
219223

220224
fueraDeCombate := false.
221-
enemigos := #().
222-
puntosDeVida := (SimpleMeasure basicNew instVarAt: 1 put: 20; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
225+
enemigos := ((Array new: 1) at: 1 put: CombatienteHumanoArthas; yourself).
226+
puntosDeVida := (SimpleMeasure basicNew instVarAt: 1 put: 18; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
223227
dañoAInfligir := (SimpleMeasure basicNew instVarAt: 1 put: 2; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
224228
dañoAAbsorber := (SimpleMeasure basicNew instVarAt: 1 put: 0; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
225-
estrategia := ((SerializableBlockClosure basicNew instVarAt: 1 put: (SerializableBlockClosure basicNew instVarAt: 1 put: CombatienteOrcoMankrik; instVarAt: 2 put: '[ :argm4_1 |
226-
argm4_1 anyOne. ]'; instVarAt: 3 put: #(); yourself); instVarAt: 2 put: '[ :argm0_1 |
227-
argm0_1 anyOne. ]'; instVarAt: 3 put: #(); yourself) asEvaluable).
229+
estrategia := ((SerializableBlockClosure basicNew instVarAt: 1 put: CombatienteOrcoMankrik; instVarAt: 2 put: '[ :argm4_1 |
230+
argm4_1 anyOne. ]'; instVarAt: 3 put: #(); yourself) asEvaluable).
228231
puntosDeAgilidad := (SimpleMeasure basicNew instVarAt: 1 put: 0; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
229232
puntosDeFuerza := (SimpleMeasure basicNew instVarAt: 1 put: 2; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
230233
estaDistraido := false.! !
@@ -303,10 +306,10 @@ prepararseParaElCombate
303306
puntosDeVida
304307
^puntosDeVida! !
305308

306-
!CombatienteOrcoOlgra class methodsFor: 'combate' stamp: 'MP 9/18/2022 20:03:40'!
309+
!CombatienteOrcoOlgra class methodsFor: 'combate' stamp: 'MP 9/20/2022 14:50:21'!
307310
recibirDaño: unaCantidadDeDaño
308311
| dañoADescontar|
309-
dañoADescontar := (unaCantidadDeDaño - dañoAAbsorber - puntosDeAgilidad) max: 0*pv.
312+
dañoADescontar := (unaCantidadDeDaño - dañoAAbsorber - puntosDeAgilidad) max: (0*pv).
310313
estaDistraido ifTrue: [dañoADescontar = 0 ifFalse: [puntosDeVida := puntosDeVida - (2*pv)]].
311314
puntosDeVida := puntosDeVida - dañoADescontar.
312315
dañoADescontar = 0 ifTrue: [estaDistraido := true] ifFalse: [estaDistraido := false].
@@ -335,13 +338,12 @@ usarHacha
335338
dañoAInfligir := 10*pv.! !
336339

337340

338-
!CombatienteOrcoOlgra class methodsFor: '--** private fileout/in **--' stamp: 'MP 9/18/2022 21:48:30'!
341+
!CombatienteOrcoOlgra class methodsFor: '--** private fileout/in **--' stamp: 'MP 9/20/2022 14:54:06'!
339342
initializeCollaboratorsFromFile
340343
"Auto generated method for loading purposes - Do not modify it"
341344

342-
estrategia := ((SerializableBlockClosure basicNew instVarAt: 1 put: (SerializableBlockClosure basicNew instVarAt: 1 put: CombatienteOrcoOlgra; instVarAt: 2 put: '[ :argm4_1 |
343-
argm4_1 anyOne. ]'; instVarAt: 3 put: #(); yourself); instVarAt: 2 put: '[ :argm0_1 |
344-
argm0_1 anyOne. ]'; instVarAt: 3 put: #(); yourself) asEvaluable).
345+
estrategia := ((SerializableBlockClosure basicNew instVarAt: 1 put: CombatienteOrcoOlgra; instVarAt: 2 put: '[ :argm4_1 |
346+
argm4_1 anyOne. ]'; instVarAt: 3 put: #(); yourself) asEvaluable).
345347
dañoAAbsorber := (SimpleMeasure basicNew instVarAt: 1 put: 0; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
346348
dañoAInfligir := (SimpleMeasure basicNew instVarAt: 1 put: 2; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
347349
puntosDeVida := (SimpleMeasure basicNew instVarAt: 1 put: 0; instVarAt: 2 put: (BaseUnit basicNew instVarAt: 1 put: 'puntosDeVida'; instVarAt: 2 put: 'puntosDeVidas'; instVarAt: 3 put: 'pv'; yourself); yourself).
@@ -895,12 +897,12 @@ noGanoNadie
895897
^self determinarGanador = 'indeterminado'! !
896898

897899

898-
!OrquestadorDeCombates class methodsFor: '--** private fileout/in **--' stamp: 'MP 9/18/2022 21:48:30'!
900+
!OrquestadorDeCombates class methodsFor: '--** private fileout/in **--' stamp: 'MP 9/20/2022 14:54:06'!
899901
initializeCollaboratorsFromFile
900902
"Auto generated method for loading purposes - Do not modify it"
901903

902-
bando1 := ((Array new: 1) at: 1 put: CombatienteHumanoArthas; yourself).
903-
bando2 := ((Array new: 1) at: 1 put: CombatienteOrcoOlgra; yourself).
904+
bando1 := ((Array new: 2) at: 1 put: CombatienteOrcoOlgra; at: 2 put: CombatienteOrcoMankrik; yourself).
905+
bando2 := ((Array new: 1) at: 1 put: CombatienteHumanoArthas; yourself).
904906
rondaActual := 10.! !
905907

906908

0 commit comments

Comments
 (0)