1
0
Преглед на файлове

[changed] new chess logic

sovietmercader преди 5 години
родител
ревизия
ed49a4531c
променени са 2 файла, в които са добавени 458 реда и са изтрити 274 реда
  1. 385 241
      locations/chessplay.qsrc
  2. 73 33
      locations/kruchess.qsrc

+ 385 - 241
locations/chessplay.qsrc

@@ -3,69 +3,158 @@
 menu_off = 1
 
 if $ARGS[0] = '':
-	if $chess_name='':$chess_name='girl'
+	if $chess_name='':$chess_name='Boy'
 	gs'stat'
 	chess_GG = 20
 	chess_com = 20
-	
-	chess_ind = (chessV - pcs_chess) / 100
-	chess_exp += rand(pcs_intel/20,pcs_intel/10)
-	intel_exp += 1
-	minut += 60
 
+	! chess_ind is used to show the integer difference between Sveta and her opponent
+	! if it is 0 then Sveta is equally skilled as her opponent
+	! the opponent will play more neutrally if the skill gap is within 5 points
+	! if it is > 0 then Sveta is less skilled then her opponent
+	! the opponent will play more aggressively if Sveta is less skilled by at least 5 points
+	! if it is < 0 then Sveta is more skilled then her opponent
+	! the opponent will play more conservatively if Sveta is more skilled by at least 5 points
+	chess_ind = chessV - pcs_chess
+	! chess_diff is used to show how that difference affects the swing in momentum with each move
+	if chess_ind < 0:
+		chess_diff = (chess_ind/2)*-1
+	else
+		chess_diff = (chess_ind/2)
+	end
+	! move_limit and time_limit keeps games from going forever
+	chess_move_limit = 60
+	chess_time_limit = 120
+	! chess_move and total_chess_time keep track of total moves and time until it hits the limits
+	chess_move = 0
+	total_chess_time = 0
 	gt 'chessplay', 'game'
 end
 
 if $ARGS[0] = 'game':
+	chess_exp += rand(0,1)
+	intel_exp += rand(0,1)
+	chess_move += 1
+	chess_time = rand(1,3)
+	minut += chess_time
+	total_chess_time += chess_time
+	gs 'stat'
 
-	if chess_GG <= 0:
-		gt 'chessplay', 'lose'
+	if chess_move = 1:
+		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/board' + rand(1,1) + '.jpg"></center>'
+		*nl
+		if chess_ind > 5:
+			'You are less skilled at chess than '+$chess_name+'. They will play more aggressively to try and defeat you.'
+			'You might want to play more conservatively and wear down their attacks.'
+		elseif chess_ind < -5:
+			'You are more skilled at chess than '+$chess_name+'. They will play more conservatively to try and defeat you.'
+			'You might want to play more aggressively and wear down their defenses.'
+		else
+			'You are about equally skilled at chess as '+$chess_name+'. They will use a wide range of moves to try and defeat you.'
+			'You might want to try different types of moves to keep your opponent off balance.'
+		end
+	end
+
+	if chess_GG <= 0 and chess_com <= 0:
+		*clr & cla
+
+		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/stalemate' + rand(1,1) + '.jpg"></center>'
+		*nl
+		'Stalemate! You have drawn the match against '+$chess_name+'!'
+		'You and '+$chess_name+' could not find a way to win the match.'
+		
+		act 'Return': gt 'kruchess'
+	elseif chess_GG <= 0:
+		*clr & cla
+
+		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/lose' + rand(1,1) + '.jpg"></center>'
+		*nl
+		'Checkmate! You have lost the match against '+$chess_name+'!'
+		
+		act 'Return': gt 'kruchess'
 	elseif chess_com <= 0:
-		gt 'chessplay', 'win'
+		*clr & cla
+
+		chess_win += 1
+
+		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/win' + rand(1,1) + '.jpg"></center>'
+		*nl
+		'Checkmate! You have won the match against '+$chess_name+'!'
+
+		act 'Return': gt 'kruchess'
+	elseif chess_moves >= chess_move_limit:
+		*clr & cla
+
+		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/stalemate' + rand(1,1) + '.jpg"></center>'
+		*nl
+		'Draw! You agree to end the match with '+$chess_name+'.'
+		'You and '+$chess_name+' have both used too many moves and neither could find a way to win the match.'
+
+		act 'Return': gt 'kruchess'
+	elseif total_chess_time >= chess_time_limit:
+		*clr & cla
+
+		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/stalemate' + rand(1,1) + '.jpg"></center>'
+		*nl
+		'Draw! You agree to end the match with '+$chess_name+'.'
+		'You and '+$chess_name+' have both used too much time and neither could find a way to win the match.'
+
+		act 'Return': gt 'kruchess'
 	else
 		gs 'chessplay', 'moves'
 	end
 end
 
 if $ARGS[0] = 'moves':
-	cla
-	act 'Go defensive':
-		chessM = rand (0,5)
-		if chessM = 0:
-			'Your opponent tries to trap you, but you avoid it and gain some advantage.'
-			if chess_ind > 2:
-				chess_GG += 2 - chess_ind
-				chess_com -= 2 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		elseif chessM = 1:
-			'Your opponent goes offensive much to their advantage.'
-			if chess_ind < -4:
-				chess_GG -= 4 + chess_ind
-				chess_com += 4 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 2:
-			'Your opponent goes aggressive you absorb some of it, but still lose some advantage.'
-			if chess_ind < -2:
-			chess_GG -= 2 + chess_ind
-				chess_com += 2 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 3:
-			'Your opponent tries to manoeuvre the game pieces, but your defensive actions expose all their efforts, much to your advantage.'
-			if chess_ind > 4:
-				chess_GG += 4 - chess_ind
-				chess_com -= 4 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		else
-			'Your opponent also goes defensive and neither of you gain any advantage.'
+	if chess_ind > 5:
+		chessM = rand(4,11)
+	elseif chess_ind < -5:
+		chessM = rand(0,7)
+	else
+		chessM = rand(2,9)
+	end
+
+	act 'Play conservatively':
+		! this works as the opposite of aggressive play
+		! conservative wins against offense and trap
+		! conservative loses to defense and tactical
+		! conservative ties with conservative and aggressive
+		*clr & cla
+
+		if chessM <= 1:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' also plays conservatively.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 3:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays defensively and is now in a better position than you.'
+			gs 'chessplay', 'advantage', 'conservative', 'bad'
+		elseif chessM <= 5:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays tactically and is able to deftly pick apart your conservative defenses.'
+			gs 'chessplay', 'advantage', 'conservative', 'bad'
+		elseif chessM <= 7:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' tries to trap you, but you encircle it with your defenses.'
+			gs 'chessplay', 'advantage', 'conservative', 'good'
+		elseif chessM <= 9:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays offensively, but your defense repulses his attacks.'
+			gs 'chessplay', 'advantage', 'conservative', 'good'
+		elseif chessM <= 11:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays aggressively, but your defense manages to hold them off.'
+			'Neither of you gain an advantage from this move.'
 		end
+		*nl
+		'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
+		'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
 
 		chess_GG -= 1
 		chess_com -= 1
@@ -73,87 +162,95 @@ if $ARGS[0] = 'moves':
 		gs 'chessplay', 'game'
 	end
 
-	act 'Heavy defense':
-		chessM = rand (0,5)
-		if chessM = 0:
-			'Your opponent tries to trap you, but you easily avoid it and gain a good advantage.'
-			if chess_ind > 4:
-				chess_GG += 4 - chess_ind
-				chess_com -= 4 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		elseif chessM = 1:
-			'Your opponent goes offensive you absorb some of it, but still lose some advantage.'
-			if chess_ind < -2:
-			chess_GG -= 2 + chess_ind
-				chess_com += 2 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 2:
-			'Your opponent goes aggressive much to their advantage.'
-			if chess_ind < -4:
-				chess_GG -= 4 + chess_ind
-				chess_com += 4 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 3:
-			'Your opponent tries to manoeuvre the game pieces, but your defensive actions expose some of their efforts, to your advantage.'
-			if chess_ind > 2:
-				chess_GG += 2 - chess_ind
-				chess_com -= 2 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		else
-			'Your opponent also goes defensive and neither of you gain any advantage.'
-		end
+	act 'Play defensively':
+		! this works as the opposite of offensive play
+		! defense wins against trap and conservative
+		! defense loses to aggressive and tactical
+		! defense ties with offense and defense
+		*clr & cla
 
+		if chessM <= 1:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays very conservatively and does not threaten your defenses at all.'
+			gs 'chessplay', 'advantage', 'defense', 'good'
+		elseif chessM <= 3:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' also plays defensively.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 5:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays tactically and is able to deftly pick apart your defenses.'
+			gs 'chessplay', 'advantage', 'defense', 'bad'
+		elseif chessM <= 7:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' tries to trap you, but you avoid it with your defenses.'
+			gs 'chessplay', 'advantage', 'defense', 'good'
+		elseif chessM <= 9:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays offensively, but your defense absorbs his attacks.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 11:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays aggressively and overwhelms your defenses.'
+			gs 'chessplay', 'advantage', 'defense', 'bad'
+		end
+		*nl
+		'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
+		'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
+		
 		chess_GG -= 1
 		chess_com -= 1
 
 		gs 'chessplay', 'game'
 	end
 
-	act 'Go offensive':
-		chessM = rand (0,5)
-		if chessM = 0:
-			'Your opponent tries to trap you, gaining some advantage.'
-			if chess_ind < -2:
-			chess_GG -= 2 + chess_ind
-				chess_com += 2 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 1:
-			'Your opponent goes offensive much to your advantage.'
-			if chess_ind > 4:
-				chess_GG += 4 - chess_ind
-				chess_com -= 4 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		elseif chessM = 2:
-			'Your opponent goes aggressive you easily absorb it, and gain some advantage.'
-			if chess_ind > 2:
-				chess_GG += 2 - chess_ind
-				chess_com -= 2 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		elseif chessM = 3:
-			'Your opponent tries to manoeuvre the game pieces, your offensive actions leave you exposed, and they take advantage.'
-			if chess_ind < -4:
-				chess_GG -= 4 + chess_ind
-				chess_com += 4 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		else
-			'Your opponent also goes on the attack and neither of you gain any advantage.'
+	act 'Play tactically':
+		! this works as the opposite of trap play
+		! tactical wins against defense and conservative
+		! tactical loses to aggressive and offense
+		! tactical ties with tactical and trap
+		*clr & cla
+
+		if chessM <= 1:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays very conservatively and your tactical moves leave you in a better position.'
+			gs 'chessplay', 'advantage', 'tactical', 'good'
+		elseif chessM <= 3:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays defensively allowing you to pick apart their defenses.'
+			gs 'chessplay', 'advantage', 'tactical', 'good'
+		elseif chessM <= 5:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' also plays tactically.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 7:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' tries to trap you, but you avoid it with your tactical movements.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 9:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays offensively, and some of your pieces are caught out of position.'
+			gs 'chessplay', 'advantage', 'tactical', 'bad'
+		elseif chessM <= 11:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays aggressively and rushes past your unprepared defenses.'
+			gs 'chessplay', 'advantage', 'tactical', 'bad'
 		end
+		*nl
+		'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
+		'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
 
 		chess_GG -= 1
 		chess_com -= 1
@@ -161,43 +258,47 @@ if $ARGS[0] = 'moves':
 		gs 'chessplay', 'game'
 	end
 
-	act 'Be aggressive':
-		chessM = rand (0,5)
-		if chessM = 0:
-			'Your opponent tries to trap you, and you are playing right into their hands.'
-			if chess_ind < -4:
-				chess_GG -= 4 + chess_ind
-				chess_com += 4 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 1:
-			'Your opponent goes defensive to your advantage.'
-			if chess_ind > 2:
-				chess_GG += 2 - chess_ind
-				chess_com -= 2 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		elseif chessM = 2:
-			'Your opponent goes heavily defensive very much to your advantage.'
-			if chess_ind > 4:
-				chess_GG += 4 - chess_ind
-				chess_com -= 4 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		elseif chessM = 3:
-			'Your opponent tries to manoeuvre the game pieces, gaining some advantage.'
-			if chess_ind < -2:
-			chess_GG -= 2 + chess_ind
-				chess_com += 2 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		else
-			'Your opponent also goes on the attack and neither of you gain any advantage.'
+	act 'Bait a trap for your opponent':
+		! this works as the opposite of tactical play
+		! trap wins against offense and aggressive
+		! trap loses to conservative and defense
+		! trap ties with tactical and trap
+		*clr & cla
+
+		if chessM <= 1:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays very conservatively and their defenses are now very well prepared.'
+			gs 'chessplay', 'advantage', 'trap', 'bad'
+		elseif chessM <= 3:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays defensively and your bait is now out of position.'
+			gs 'chessplay', 'advantage', 'trap', 'bad'
+		elseif chessM <= 5:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays tactically and avoids your trap.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 7:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' also tries to trap you.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 9:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays offensively, and a couple of their pieces are caught out of position.'
+			gs 'chessplay', 'advantage', 'trap', 'good'
+		elseif chessM <= 11:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays aggressively and many of their pieces fall into your trap.'
+			gs 'chessplay', 'advantage', 'trap', 'good'
 		end
+		*nl
+		'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
+		'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
 
 		chess_GG -= 1
 		chess_com -= 1
@@ -205,43 +306,47 @@ if $ARGS[0] = 'moves':
 		gs 'chessplay', 'game'
 	end
 
-	act 'Bait trap':
-		chessM = rand (0,5)
-		if chessM = 0:
-			'Your opponent goes offensive to your advantage.'
-			if chess_ind > 2:
-				chess_GG += 2 - chess_ind
-				chess_com -= 2 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		elseif chessM = 1:
-			'Your opponent goes defensive to their advantage.'
-			if chess_ind < -2:
-				chess_GG -= 2 + chess_ind
-				chess_com += 2 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 2:
-			'Your opponent goes heavily defensive exposing your tactics much to their advantage.'
-			if chess_ind < -4:
-				chess_GG -= 4 + chess_ind
-				chess_com += 4 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 3:
-			'Your opponent goes aggressive much to your advantage.'
-			if chess_ind > 4:
-				chess_GG += 4 - chess_ind
-				chess_com -= 4 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		else
-			'Your opponent also goes tactical and neither of you gain any advantage.'
+	act 'Play offensively':
+		! this works as the opposite of defensive play
+		! offense wins against tactical and aggressive
+		! offense loses to conservative and trap
+		! offense ties with offense and defense
+		*clr & cla
+
+		if chessM <= 1:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays very conservatively and repulses all your attacks.'
+			gs 'chessplay', 'advantage', 'offense', 'bad'
+		elseif chessM <= 3:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays defensively and manages to absorb all your attacks.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 5:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays tactically, but your offense is able to outmaneuver them.'
+			gs 'chessplay', 'advantage', 'offense', 'good'
+		elseif chessM <= 7:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' traps some of your pieces. You should think more carefully next time.'
+			gs 'chessplay', 'advantage', 'offense', 'bad'
+		elseif chessM <= 9:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' also plays offensively.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 11:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays aggressively and overextends themselves.'
+			gs 'chessplay', 'advantage', 'offense', 'good'
 		end
+		*nl
+		'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
+		'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
 
 		chess_GG -= 1
 		chess_com -= 1
@@ -249,43 +354,47 @@ if $ARGS[0] = 'moves':
 		gs 'chessplay', 'game'
 	end
 
-	act 'Manoeuvre the game pieces':
-		chessM = rand (0,5)
-		if chessM = 0:
-			'Your opponent goes offensive, much to your advantage.'
-			if chess_ind > 4:
-				chess_GG += 4 - chess_ind
-				chess_com -= 4 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		elseif chessM = 1:
-			'Your opponent goes defensive much to their advantage.'
-			if chess_ind < -4:
-				chess_GG -= 4 + chess_ind
-				chess_com += 4 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 2:
-			'Your opponent goes heavily defensive exposing your tactics to their advantage.'
-			if chess_ind < -2:
-			chess_GG -= 2 + chess_ind
-				chess_com += 2 - chess_ind
-			else
-				'However your superior skill negates that advantage.'
-			end
-		elseif chessM = 3:
-			'Your opponent goes aggressive to your advantage.'
-			if chess_ind > 2:
-				chess_GG += 2 - chess_ind
-				chess_com -= 2 + chess_ind
-			else
-				'However their superior skill negates that advantage.'
-			end
-		else
-			'Your opponent also goes tactical and neither of you gain any advantage.'
+	act 'Play aggressively':
+		! this works as the opposite of conservative play
+		! aggressive wins against defense and tactical
+		! aggressive loses to offense and trap
+		! aggressive ties with conservative and aggressive
+		*clr & cla
+
+		if chessM <= 1:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/conservative' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays conservatively and their defenses manage to hold you off.'
+			'Neither of you gain an advantage from this move.'
+		elseif chessM <= 3:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/defensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays defensively and you overwhelm a few of their pieces.'
+			gs 'chessplay', 'advantage', 'aggressive', 'good'
+		elseif chessM <= 5:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/tactical' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays tactically and cannot cope with your aggressive moves.'
+			gs 'chessplay', 'advantage', 'aggressive', 'good'
+		elseif chessM <= 7:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/trap' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' tries to trap you, but some of your pieces fall for it.'
+			gs 'chessplay', 'advantage', 'aggressive', 'bad'
+		elseif chessM <= 9:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/offensive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' plays offensively, leaving some of your pieces exposed.'
+			gs 'chessplay', 'advantage', 'aggressive', 'bad'
+		elseif chessM <= 11:
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/aggressive' + rand(1,1) + '.jpg"></center>'
+			*nl
+			$chess_name+' also plays aggressively.'
+			'Neither of you gain an advantage from this move.'
 		end
+		*nl
+		'You are on move '+str(chess_move)+' out of '+str(chess_move_limit)
+		'You are on minute '+str(total_chess_time)+' out of '+str(chess_time_limit)
 
 		chess_GG -= 1
 		chess_com -= 1
@@ -294,22 +403,57 @@ if $ARGS[0] = 'moves':
 	end
 end
 
+! $ARGS[1] = move chosen by player - used to set base skill difference and advantage change
+! $ARGS[2] = whether this move was a good choice - whether Sveta should gain or lose advantage
+if $ARGS[0] = 'advantage':
+	! conservative and aggressive are the most extreme and therefore have the biggest reward and risk
+	! but also requires the greatest difference in skill to pull off successfully or prevent your opponent from using successfully
+	if $ARGS[1] = 'conservative' or $ARGS[1] = 'aggressive':
+		chess_pos = 4
+		chess_neg = -4
+		chess_adv = 4
+	! defense and offense are a middle ground and have medium reward and risk
+	! requires a medium skill gap to pull off successfully or prevent your opponent from using successfully
+	elseif $ARGS[1] = 'defense' or $ARGS[1] = 'offense':
+		chess_pos = 2
+		chess_neg = -2
+		chess_adv = 2
+	! tactical and trap are the least extreme and therefore have the least reward and risk
+	! they require the least difference in skill to pull off successfully or prevent your opponent from using successfully
+	elseif $ARGS[1] = 'tactical' or $ARGS[1] = 'trap':
+		chess_pos = 1
+		chess_neg = -1
+		chess_adv = 1	
+	end
 
-if $ARGS[0] = 'win':
-	*clr & cla
-	gs 'stat'
-	chess_win += 1
-	'You have won this game.'
-	act 'Return': gt $loc
-end
-
-if $ARGS[0] = 'lose':
-	*clr & cla
-	gs 'stat'
-	'You have lost this game.'
-	act 'Return': gt $loc
+	if $ARGS[2] = 'good':
+		if chess_ind > chess_pos:
+			'You are less skilled than your opponent and cannot capitalize on your advantage.'
+			'Try to gain more skill at chess to use this move successfully against this opponent.'
+		elseif chess_ind < chess_neg:
+			'You are more skilled than your opponent and gain a major advantage.'
+			chess_GG = chess_GG + chess_adv + chess_diff
+			chess_com = chess_com - chess_adv - chess_diff
+		else
+			'You are about equally skilled as your opponent and gain some advantage.'
+			chess_GG = chess_GG + chess_adv/2 + chess_diff/2
+			chess_com = chess_com - chess_adv/2 - chess_diff/2
+		end
+	elseif $ARGS[2] = 'bad':
+		if chess_ind > chess_pos:
+			'You are less skilled than your opponent and you lose a major advantage.'
+			'Try to gain more skill at chess to prevent your opponent from using this move successfully.'
+			chess_GG = chess_GG - chess_adv - chess_diff
+			chess_com = chess_com + chess_adv + chess_diff
+		elseif chess_ind < chess_neg:
+			'You are more skilled than your opponent and prevent them from capitalizing on their advantage.'			
+		else
+			'You are about equally skilled as your opponent and you lose some advantage.'
+			chess_GG = chess_GG - chess_adv/2 - chess_diff/2
+			chess_com = chess_com + chess_adv/2 + chess_diff/2
+		end
+	end
 end
 
-
 --- chessplay ---------------------------------
 

+ 73 - 33
locations/kruchess.qsrc

@@ -11,90 +11,130 @@ gs 'themes', 'indoors'
 
 '<center><b><font color = maroon>Chess Club</font></b></center>'
 '<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/kruchess.jpg"></center>'
+*nl
 
 if hour > 20:
 	'Chess club is closed. The coach and some players are tidying away the boards and pieces.'
+
 	act 'Leave':gt'gdkkru'
 else
 	if week ! 6:
-		'The kids are sitting around playing practice games, while being watched over and helped by coach Genrikh.'
+		'The kids are sitting around playing practice games, while being watched over and helped by Coach Genrikh.'
+
 		act 'Spend an hour practicing with assistance from the coach':
-			cla
-			*nl
-			chess_exp += rand(pcs_intel/20,pcs_intel/10)
-			intel_exp += 1
+			*clr & cla
+			chess_exp += rand(0,1)
+			intel_exp += rand(0,1)
 			minut += 60
+			gs 'stat'
+
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/play' + rand(1,2) + '.jpg"></center>'
+			*nl
 			'You spend the next hour practicing against the other players with the coach walking around and stopping to help out or point things out. You learn a little every time. You also discuss the various chess openings and which ones are the best, which can often get lively.'
+
 			act 'Return': gt 'kruchess'
 		end
 		act 'Talk to the other players':
 			*clr & cla
-			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/talk.jpg"></center>'
 			minut += 30
-			pcs_mood +=5
+			pcs_mood += 5
+			gs 'stat'
+
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/talk.jpg"></center>'
+			*nl
 			'You take a break from playing and talk to a couple of your fellow chess enthusiasts. After first focusing on chess for a while, the conversation drifts off to other topics. You have a good time chatting and relaxing.'
+
 			act 'Return': gt 'kruchess'
 		end
 		act 'Talk to Evgeny Kuznetsov':
 			*clr & cla
-			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/talk.jpg"></center>'
 			minut += 30
 			chess_exp += 2
 			npc_rel['A151'] += 5
+			gs 'stat'
+
+			'<center><img <<$set_imgh>> src="images/characters/pavlovsk/school/head/35.jpg"></center>'
+			*nl
 			'You sit down next to Evgeny to talk. At first you try to catch his interest with ordinary things; he barely even responds to you, preoccupied playing against himself. Then you bring up a recent opening you have been trying and he perks up. Soon the two of you are talking about various openings and he shares with you some of his favorite ones and how he moves them to the mid game. You learn a bit about chess and feel like you are better friends with Evgeny.'
+
 			act 'Return': gt 'kruchess'
 		end
 	else
 		'On Saturdays, after a week''s training, club members spend the whole day playing against each other.'
+		*nl
+		if chess_win < 5:
+			'You have beaten Vitalik '+str(chess_win)+' times.'
+		elseif chess_win >= 5 and chess_win < 10:
+			'You have beaten Vitalik 5 times. You cannot play against him anymore.'
+			'You have beaten Kostya '+str(chess_win-5)+' times.'
+		elseif chess_win >= 10 and chess_win < 15:
+			'You have beaten Vitalik 5 times. You cannot play against him anymore.'
+			'You have beaten Kostya 5 times. You cannot play against him anymore.'
+			'You have beaten Sergei '+str(chess_win-10)+' times.'
+		elseif chess_win >= 15 and chess_win < 20:
+			'You have beaten Vitalik 5 times. You cannot play against him anymore.'
+			'You have beaten Kostya 5 times. You cannot play against him anymore.'
+			'You have beaten Sergei 5 times. You cannot play against him anymore.'
+			'You have beaten Coach Genrikh '+str(chess_win-15)+' times.'
+		elseif chess_win >= 20:
+			'You have beaten Vitalik 5 times. You cannot play against him anymore.'
+			'You have beaten Kostya 5 times. You cannot play against him anymore.'
+			'You have beaten Sergei 5 times. You cannot play against him anymore.'
+			'You have beaten Coach Genrikh 5 times. You cannot play against him anymore.'
+			'You have beaten Evgeny Kuznetsov '+str(chess_win-20)+' times. He is the only opponent left you can challenge.'
+		end
+		'You have won a total of '+str(chess_win)+' chess matches.'
+		*nl
+
 		if chess_win < 5:
-			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/play' + rand(1,2) + '.jpg"></center>'
 			'You are paired against Vitalik, the youngest boy in the club. Despite his age he has already achieved rank 4, the lowest official chess rank corresponding to an ELO rating of 1000+.'
-			act'Play':
+
+			act 'Play chess with Vitalik':
 				*clr & cla
 				$chess_name='Vitalik'
-				chessV=40
-				gt'chessplay'
+				chessV=10
+				gt 'chessplay'
 			end
 		elseif chess_win < 10:
-			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/play' + rand(1,2) + '.jpg"></center>'
 			'You get to play against Kostya, who recently advanced to rank 3 after passing 1400 ELO points.'
-			act'Play':
+
+			act 'Play chess with Kostya':
 				*clr & cla
 				$chess_name='Kostya'
-				chessV=100
-				gt'chessplay'
+				chessV=30
+				gt 'chessplay'
 			end
 		elseif chess_win < 15:
-			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/play' + rand(1,2) + '.jpg"></center>'
 			'You sit down to play Sergei. You recall that he is a rank 2 player with an ELO rating of more than 1600.'
-			act'Play':
+
+			act 'Play chess with Sergei':
 				*clr & cla
 				$chess_name='Sergei'
-				chessV=300
-				gt'chessplay'
+				chessV=50
+				gt 'chessplay'
 			end
 		elseif chess_win < 20:
-			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/play' + rand(1,2) + '.jpg"></center>'
-			'You are facing the chess coach. At his peak he achieved an ELO ranking of just over 2000, and despite his skills declining with age he still plays at the level of a rank 1 player.'
-			act'Play':
+			'You are facing Coach Genrikh. At his peak he achieved an ELO ranking of just over 2000, and despite his skills declining with age he still plays at the level of a rank 1 player.'
+
+			act 'Play chess with Coach Genrikh':
 				*clr & cla
-				$chess_name='Coach Genrikh G.'
-				chessV=800
-				gt'chessplay'
+				$chess_name='Coach Genrikh'
+				chessV=70
+				gt 'chessplay'
 			end
-		else
-			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/community/chess/play' + rand(1,2) + '.jpg"></center>'
-			'You are facing Evgeny Kuznetsov. He has already won the regional championship twice and placed well at the nationals each year he has attended. He is already rated above a 2200 in the ELO rankings.'
-			act'Play':
+		elseif chess_win >= 20:
+			'You are challenging Evgeny Kuznetsov. He has already won the regional championship twice and placed well at the nationals each year he has attended. He is already rated above a 2200 in the ELO rankings.'
+
+			act 'Play chess with Evgeny':
 				*clr & cla
 				$chess_name='Evgeny'
-				chessV=900
-				gt'chessplay'
+				chessV=90
+				gt 'chessplay'
 			end
 		end
 	end
 
-	act 'Leave':gt'gdkkru'
+	act 'Leave':gt 'gdkkru'
 end
 
 --- kruchess ---------------------------------