Improve Darcap's Manor, add more rewards, tune monsters down.
git-svn-id: svn://svn.code.sf.net/p/crossfire/code/maps/trunk@21950 282e977c-c81d-0410-88c4-b93c2d0d6712master
parent
ae27808cfd
commit
ce70165a3d
|
@ -1,3 +1,9 @@
|
|||
2021-02-12 Nicolas Weeger
|
||||
* darcap/darcap/manor.ground: Add gates, make Politos dialog Python-based.
|
||||
* darcap/darcap/manor.treasure: Shrink map, add more rewards.
|
||||
* darcap/darcap/manor.white: Use less evil monsters.
|
||||
* python/maps/darcap/manor.py: Complete the script for the reward and Politos's dialog.
|
||||
|
||||
2021-02-11 Nicolas Weeger
|
||||
* styles/monsterstyles/nethack/nethack_13,
|
||||
* styles/monsterstyles/nethack/nethack_14,
|
||||
|
|
|
@ -3,9 +3,11 @@ name Darcap's Manor
|
|||
region darcap
|
||||
width 20
|
||||
height 20
|
||||
enter_x 9
|
||||
enter_y 17
|
||||
msg
|
||||
Created: 2010-10-10 Nicolas Weeger
|
||||
Modified: 2012-01-29 Rick Tanner
|
||||
Modified: 2021-02-12 Nicolas Weeger
|
||||
endmsg
|
||||
end
|
||||
arch grass_only
|
||||
|
@ -461,6 +463,11 @@ arch tile_shop
|
|||
x 4
|
||||
y 6
|
||||
end
|
||||
arch igate_closed_1
|
||||
x 4
|
||||
y 6
|
||||
connected 1
|
||||
end
|
||||
arch tile_shop
|
||||
x 4
|
||||
y 7
|
||||
|
@ -496,6 +503,10 @@ arch tile_shop
|
|||
x 4
|
||||
y 13
|
||||
end
|
||||
arch igate_closed_1
|
||||
x 4
|
||||
y 13
|
||||
end
|
||||
arch tile_shop
|
||||
x 4
|
||||
y 14
|
||||
|
@ -867,7 +878,7 @@ end
|
|||
arch stair_up_1
|
||||
name manor.treasure
|
||||
slaying manor.treasure
|
||||
hp 8
|
||||
hp 4
|
||||
sp 1
|
||||
x 8
|
||||
y 3
|
||||
|
@ -888,6 +899,10 @@ arch tile_shop
|
|||
x 8
|
||||
y 7
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 8
|
||||
y 8
|
||||
end
|
||||
arch tile_shop
|
||||
x 8
|
||||
y 8
|
||||
|
@ -897,6 +912,10 @@ x 8
|
|||
y 8
|
||||
move_block all
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 8
|
||||
y 9
|
||||
end
|
||||
arch tile_shop
|
||||
x 8
|
||||
y 9
|
||||
|
@ -906,6 +925,10 @@ x 8
|
|||
y 9
|
||||
move_block all
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 8
|
||||
y 10
|
||||
end
|
||||
arch tile_shop
|
||||
x 8
|
||||
y 10
|
||||
|
@ -915,6 +938,10 @@ x 8
|
|||
y 10
|
||||
move_block all
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 8
|
||||
y 11
|
||||
end
|
||||
arch tile_shop
|
||||
x 8
|
||||
y 11
|
||||
|
@ -987,7 +1014,7 @@ end
|
|||
arch stair_up_1
|
||||
name manor.treasure
|
||||
slaying manor.treasure
|
||||
hp 9
|
||||
hp 5
|
||||
sp 1
|
||||
x 9
|
||||
y 3
|
||||
|
@ -1008,6 +1035,10 @@ arch tile_shop
|
|||
x 9
|
||||
y 7
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 9
|
||||
y 8
|
||||
end
|
||||
arch tile_shop
|
||||
x 9
|
||||
y 8
|
||||
|
@ -1025,24 +1056,26 @@ arch a_townsman3
|
|||
name Politos
|
||||
msg
|
||||
@match *
|
||||
***************************
|
||||
Note: This is a work in progress. Only one reward for now, even though all keys are required.
|
||||
***************************
|
||||
|
||||
|
||||
Hello, welcome to Darcap's manor!
|
||||
|
||||
If you want to get a treasure from upstairs, you need to find three keys: blue, white, brown.
|
||||
|
||||
You can get one from each of the corners of this room, provided you are strong or smart enough, of course.
|
||||
Unfortunately, the manor is currently closed for maintenance.
|
||||
endmsg
|
||||
x 9
|
||||
y 9
|
||||
arch event_say
|
||||
name politos
|
||||
title Python
|
||||
slaying /python/maps/darcap/manor.py
|
||||
end
|
||||
end
|
||||
arch tile_shop
|
||||
x 9
|
||||
y 10
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 9
|
||||
y 11
|
||||
end
|
||||
arch tile_shop
|
||||
x 9
|
||||
y 11
|
||||
|
@ -1119,7 +1152,7 @@ end
|
|||
arch stair_up_1
|
||||
name manor.treasure
|
||||
slaying manor.treasure
|
||||
hp 10
|
||||
hp 6
|
||||
sp 1
|
||||
x 10
|
||||
y 3
|
||||
|
@ -1140,6 +1173,10 @@ arch tile_shop
|
|||
x 10
|
||||
y 7
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 10
|
||||
y 8
|
||||
end
|
||||
arch tile_shop
|
||||
x 10
|
||||
y 8
|
||||
|
@ -1157,6 +1194,15 @@ arch tile_shop
|
|||
x 10
|
||||
y 10
|
||||
end
|
||||
arch button_lever
|
||||
x 10
|
||||
y 10
|
||||
connected 1
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 10
|
||||
y 11
|
||||
end
|
||||
arch tile_shop
|
||||
x 10
|
||||
y 11
|
||||
|
@ -1233,7 +1279,7 @@ end
|
|||
arch stair_up_1
|
||||
name manor.treasure
|
||||
slaying manor.treasure
|
||||
hp 11
|
||||
hp 7
|
||||
sp 1
|
||||
x 11
|
||||
y 3
|
||||
|
@ -1254,6 +1300,10 @@ arch tile_shop
|
|||
x 11
|
||||
y 7
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 11
|
||||
y 8
|
||||
end
|
||||
arch tile_shop
|
||||
x 11
|
||||
y 8
|
||||
|
@ -1263,6 +1313,10 @@ x 11
|
|||
y 8
|
||||
move_block all
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 11
|
||||
y 9
|
||||
end
|
||||
arch tile_shop
|
||||
x 11
|
||||
y 9
|
||||
|
@ -1272,6 +1326,10 @@ x 11
|
|||
y 9
|
||||
move_block all
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 11
|
||||
y 10
|
||||
end
|
||||
arch tile_shop
|
||||
x 11
|
||||
y 10
|
||||
|
@ -1281,6 +1339,10 @@ x 11
|
|||
y 10
|
||||
move_block all
|
||||
end
|
||||
arch dungeon_magic
|
||||
x 11
|
||||
y 11
|
||||
end
|
||||
arch tile_shop
|
||||
x 11
|
||||
y 11
|
||||
|
@ -1682,6 +1744,11 @@ arch tile_shop
|
|||
x 15
|
||||
y 6
|
||||
end
|
||||
arch igate_closed_1
|
||||
x 15
|
||||
y 6
|
||||
connected 1
|
||||
end
|
||||
arch tile_shop
|
||||
x 15
|
||||
y 7
|
||||
|
@ -1717,6 +1784,11 @@ arch tile_shop
|
|||
x 15
|
||||
y 13
|
||||
end
|
||||
arch igate_closed_1
|
||||
x 15
|
||||
y 13
|
||||
connected 1
|
||||
end
|
||||
arch tile_shop
|
||||
x 15
|
||||
y 14
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4,9 +4,11 @@ difficulty 40
|
|||
region darcap
|
||||
width 40
|
||||
height 30
|
||||
enter_x 28
|
||||
enter_y 28
|
||||
msg
|
||||
Created: 2010-10-17 Nicolas Weeger
|
||||
Modified: 2012-03-21 Rick Tanner
|
||||
Modified: 2021-02-12 Nicolas Weeger
|
||||
endmsg
|
||||
end
|
||||
arch tile_shop
|
||||
|
@ -593,6 +595,10 @@ arch tile_shop
|
|||
x 3
|
||||
y 7
|
||||
end
|
||||
arch g_worm
|
||||
x 3
|
||||
y 7
|
||||
end
|
||||
arch tile_shop
|
||||
x 3
|
||||
y 8
|
||||
|
@ -784,10 +790,6 @@ arch tile_shop
|
|||
x 4
|
||||
y 9
|
||||
end
|
||||
arch gryphon
|
||||
x 4
|
||||
y 9
|
||||
end
|
||||
arch tile_shop
|
||||
x 4
|
||||
y 10
|
||||
|
@ -1087,10 +1089,6 @@ arch tile_shop
|
|||
x 6
|
||||
y 7
|
||||
end
|
||||
arch archon
|
||||
x 6
|
||||
y 7
|
||||
end
|
||||
arch tile_shop
|
||||
x 6
|
||||
y 8
|
||||
|
@ -1099,6 +1097,10 @@ arch tile_shop
|
|||
x 6
|
||||
y 9
|
||||
end
|
||||
arch g_worm
|
||||
x 6
|
||||
y 9
|
||||
end
|
||||
arch tile_shop
|
||||
x 6
|
||||
y 10
|
||||
|
@ -2115,6 +2117,10 @@ arch tile_shop
|
|||
x 12
|
||||
y 2
|
||||
end
|
||||
arch living_chaos
|
||||
x 12
|
||||
y 2
|
||||
end
|
||||
arch tile_shop
|
||||
x 12
|
||||
y 3
|
||||
|
@ -2266,22 +2272,18 @@ arch tile_shop
|
|||
x 13
|
||||
y 3
|
||||
end
|
||||
arch s_mastif
|
||||
x 13
|
||||
y 3
|
||||
end
|
||||
arch tile_shop
|
||||
x 13
|
||||
y 4
|
||||
end
|
||||
arch s_mastif
|
||||
x 13
|
||||
y 4
|
||||
end
|
||||
arch tile_shop
|
||||
x 13
|
||||
y 5
|
||||
end
|
||||
arch living_chaos
|
||||
x 13
|
||||
y 5
|
||||
end
|
||||
arch tile_shop
|
||||
x 13
|
||||
y 6
|
||||
|
@ -2563,10 +2565,6 @@ arch tile_shop
|
|||
x 15
|
||||
y 1
|
||||
end
|
||||
arch s_mastif
|
||||
x 15
|
||||
y 1
|
||||
end
|
||||
arch tile_shop
|
||||
x 15
|
||||
y 2
|
||||
|
@ -2733,6 +2731,10 @@ arch tile_shop
|
|||
x 16
|
||||
y 3
|
||||
end
|
||||
arch living_chaos
|
||||
x 16
|
||||
y 3
|
||||
end
|
||||
arch tile_shop
|
||||
x 16
|
||||
y 4
|
||||
|
@ -2902,10 +2904,6 @@ arch tile_shop
|
|||
x 17
|
||||
y 4
|
||||
end
|
||||
arch s_mastif
|
||||
x 17
|
||||
y 4
|
||||
end
|
||||
arch tile_shop
|
||||
x 17
|
||||
y 5
|
||||
|
@ -2914,10 +2912,6 @@ arch tile_shop
|
|||
x 17
|
||||
y 6
|
||||
end
|
||||
arch s_mastif
|
||||
x 17
|
||||
y 6
|
||||
end
|
||||
arch tile_shop
|
||||
x 17
|
||||
y 7
|
||||
|
@ -3678,6 +3672,10 @@ arch tile_shop
|
|||
x 21
|
||||
y 5
|
||||
end
|
||||
arch leech
|
||||
x 21
|
||||
y 5
|
||||
end
|
||||
arch tile_shop
|
||||
x 21
|
||||
y 6
|
||||
|
@ -4010,6 +4008,10 @@ arch tile_shop
|
|||
x 23
|
||||
y 3
|
||||
end
|
||||
arch leech
|
||||
x 23
|
||||
y 3
|
||||
end
|
||||
arch tile_shop
|
||||
x 23
|
||||
y 4
|
||||
|
@ -4050,10 +4052,6 @@ arch tile_shop
|
|||
x 23
|
||||
y 9
|
||||
end
|
||||
arch s_wyvern
|
||||
x 23
|
||||
y 9
|
||||
end
|
||||
arch tile_shop
|
||||
x 23
|
||||
y 10
|
||||
|
@ -4220,6 +4218,10 @@ arch tile_shop
|
|||
x 24
|
||||
y 9
|
||||
end
|
||||
arch leech
|
||||
x 24
|
||||
y 9
|
||||
end
|
||||
arch tile_shop
|
||||
x 24
|
||||
y 10
|
||||
|
@ -4737,10 +4739,6 @@ arch tile_shop
|
|||
x 27
|
||||
y 4
|
||||
end
|
||||
arch s_wyvern
|
||||
x 27
|
||||
y 4
|
||||
end
|
||||
arch tile_shop
|
||||
x 27
|
||||
y 5
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
import random
|
||||
# -*- coding: utf-8 -*-
|
||||
# Script handling various things for Darcap Manor.
|
||||
#
|
||||
# It is used:
|
||||
# - in the blue zone, to count how many kobolds are on the map
|
||||
# - for the potion, to explode walls in the treasure room
|
||||
# - in the brown zone, to prevent Kaptel's death or trigger the opening of the exit
|
||||
# - in the white zone, to check if the player knows how many of a certain jewel there are
|
||||
# - for the potion, to explode walls in the treasure room
|
||||
# - in the treasure room, to select the reward
|
||||
|
||||
import random
|
||||
import Crossfire
|
||||
|
||||
def blue_count_kobolds():
|
||||
'''Count the number of kobolds on the map for the blue zone.'''
|
||||
map = Crossfire.WhoAmI().Map
|
||||
count = 0
|
||||
for x in range(map.Width):
|
||||
|
@ -25,28 +27,18 @@ def blue_count_kobolds():
|
|||
return count
|
||||
|
||||
def blue_check():
|
||||
'''Player triggered the lever, check if correct number of kobolds. '''
|
||||
'''Player triggered the lever, check if correct number of kobolds.'''
|
||||
|
||||
if blue_count_kobolds() != 4:
|
||||
Crossfire.SetReturnValue(1)
|
||||
Crossfire.WhoIsActivator().Message('The level will only activate if there are exactly 4 kobolds on the map')
|
||||
return
|
||||
|
||||
def potion_find_wall(map, x, y, name):
|
||||
'''Find the wall of a given archetype at the specified location.'''
|
||||
item = map.ObjectAt(x, y)
|
||||
while item:
|
||||
if item.ArchName == name:
|
||||
return item
|
||||
item = item.Above
|
||||
|
||||
return None
|
||||
|
||||
def potion_check():
|
||||
"""Handle the Darcap Manor's potion being thrown. Check if walls to destroy in the treasure room."""
|
||||
|
||||
# note: duplication with /CFMove.py, should be factorised at some point
|
||||
dir_x = [ 0, 0, 1, 1, 1, 0, -1, -1, -1 ]
|
||||
dir_x = [ 0, 0, 1, 1, 1, 0, -1, -1, -1 ]
|
||||
dir_y = [ 0, -1, -1, 0, 1, 1, 1, 0, -1 ]
|
||||
|
||||
env = Crossfire.WhoAmI().Env
|
||||
|
@ -60,11 +52,11 @@ def potion_check():
|
|||
if y != 4 and y != 8 and y != 12:
|
||||
return
|
||||
|
||||
if x != 9 and x != 10:
|
||||
if x != 4 and x != 5:
|
||||
return
|
||||
|
||||
left = potion_find_wall(env.Map, 9, y, 'cwall_mural_1_1')
|
||||
right = potion_find_wall(env.Map, 10, y, 'cwall_mural_1_2')
|
||||
left = env.Map.Check('cwall_mural_1_1', (4, y))
|
||||
right = env.Map.Check('cwall_mural_1_2', (5, y))
|
||||
|
||||
if left == None or right == None:
|
||||
# hu?
|
||||
|
@ -73,8 +65,10 @@ def potion_check():
|
|||
left.Remove()
|
||||
right.Remove()
|
||||
|
||||
env.Map.CreateObject('rubble', 9, y)
|
||||
env.Map.CreateObject('rubble', 10, y)
|
||||
env.Map.CreateObject('rubble', 4, y)
|
||||
env.Map.CreateObject('rubble', 5, y)
|
||||
env.Map.CreateObject('explosion2', 4, y)
|
||||
env.Map.CreateObject('explosion2', 5, y)
|
||||
|
||||
Crossfire.WhoAmI().Remove()
|
||||
|
||||
|
@ -101,6 +95,7 @@ def kaptel_death():
|
|||
Crossfire.SetReturnValue(1)
|
||||
|
||||
def challenge_correct_reply(count, msg):
|
||||
'''Check if the reply to the challenge is correct.'''
|
||||
if count == 0:
|
||||
return msg == '0' or msg == 'none'
|
||||
return count == int(msg)
|
||||
|
@ -170,11 +165,144 @@ def white_challenge():
|
|||
else:
|
||||
ear.Say('Sorry, that is not the correct reply. Please try again later.')
|
||||
|
||||
if Crossfire.ScriptParameters() == 'blue':
|
||||
def claim_reward():
|
||||
'''Handle the player applying the lever to get her reward.'''
|
||||
rewards = { # Gate positions for the rewards
|
||||
'amethysts': [2, 15],
|
||||
'glowing_crystal': [2, 17],
|
||||
'potion': [3, 18],
|
||||
'townportal': [5, 18],
|
||||
'lunar_shield': [7, 18],
|
||||
'wizard_gloves': [10, 15],
|
||||
'black_dragon_mail': [10, 17],
|
||||
}
|
||||
chances = [ # Possible rewards, one is selected in the list so some items are repeated to make them more probably
|
||||
'amethysts',
|
||||
'amethysts',
|
||||
'amethysts',
|
||||
'amethysts',
|
||||
'glowing_crystal',
|
||||
'glowing_crystal',
|
||||
'glowing_crystal',
|
||||
'potion',
|
||||
'potion',
|
||||
'townportal',
|
||||
'townportal',
|
||||
'lunar_shield',
|
||||
'wizard_gloves',
|
||||
'black_dragon_mail',
|
||||
]
|
||||
|
||||
def swap_gate(item, delete = False):
|
||||
# lever.Map.Print('item = %d'%(item))
|
||||
x = rewards[chances[item]][0]
|
||||
y = rewards[chances[item]][1]
|
||||
gate = lever.Map.ObjectAt(x, y).Above.Above
|
||||
replace = ''
|
||||
glow = 0
|
||||
if gate.ArchName == 'grate_closed_1':
|
||||
replace = 'igate_closed_1'
|
||||
elif gate.ArchName == 'grate_closed_2':
|
||||
replace = 'igate_closed_2'
|
||||
elif gate.ArchName == 'igate_closed_1':
|
||||
replace = 'grate_closed_1'
|
||||
glow = 5
|
||||
elif gate.ArchName == 'igate_closed_2':
|
||||
replace = 'grate_closed_2'
|
||||
glow = 5
|
||||
else:
|
||||
# lever.Map.Print('found %s'%(gate.ArchName))
|
||||
return
|
||||
# lever.Map.Print('%d %d %s => %s'%(x, y, gate.ArchName, replace))
|
||||
gate.Remove()
|
||||
if delete:
|
||||
return
|
||||
ob = lever.Map.CreateObject(replace, x, y)
|
||||
if glow != 0:
|
||||
ob.GlowRadius = glow
|
||||
|
||||
|
||||
Crossfire.SetReturnValue(1)
|
||||
lever = Crossfire.WhoAmI()
|
||||
event = Crossfire.WhatIsEvent()
|
||||
status = lever.ReadKey('status')
|
||||
if event.Subtype == Crossfire.EventType.APPLY:
|
||||
if status == '':
|
||||
lever.Map.Print('And now you shall get your reward!')
|
||||
lever.WriteKey('status', 'start', 1)
|
||||
lever.WriteKey('reward', str(random.randint(0, len(chances))), 1)
|
||||
lever.WriteKey('left', str(random.randint(1, 3) + random.randint(1, 3) + random.randint(1, 3)), 1)
|
||||
lever.WriteKey('current', '-1', 1)
|
||||
lever.CreateTimer(1 + random.randint(1, 3), 2)
|
||||
return
|
||||
elif event.Subtype == Crossfire.EventType.TIMER:
|
||||
if lever.Map.Darkness < 5:
|
||||
lever.Map.ChangeLight(1)
|
||||
lever.CreateTimer(1 + random.randint(1, 3), 2)
|
||||
return
|
||||
|
||||
left = int(lever.ReadKey('left'))
|
||||
current = int(lever.ReadKey('current'))
|
||||
if left == 0:
|
||||
lever.Map.Print("Yes! Congratulations!")
|
||||
while lever.Map.Darkness > 0:
|
||||
lever.Map.ChangeLight(-1)
|
||||
swap_gate(current, True)
|
||||
|
||||
else:
|
||||
if current != -1:
|
||||
lever.Map.Print('No!')
|
||||
# lever.Map.Print('restoring')
|
||||
swap_gate(current)
|
||||
lever.WriteKey('current', '-1', 1)
|
||||
lever.CreateTimer(1 + random.randint(1, 3), 2)
|
||||
return
|
||||
|
||||
left -= 1
|
||||
lever.WriteKey('left', str(left), 1)
|
||||
|
||||
current = random.randint(0, len(chances) - 1)
|
||||
swap_gate(current)
|
||||
lever.WriteKey('current', str(current), 1)
|
||||
lever.CreateTimer(1 + random.randint(1, 2), 1)
|
||||
lever.Map.Print('Will it be this reward?')
|
||||
|
||||
def politos():
|
||||
'''Handle Politos's dialog in the entrance.'''
|
||||
msg = Crossfire.WhatIsMessage()
|
||||
politos = Crossfire.WhoAmI()
|
||||
pl = Crossfire.WhoIsActivator()
|
||||
status = politos.ReadKey('opened')
|
||||
|
||||
if msg == 'potion':
|
||||
politos.Say("This potion will replace any of the three keys, but you have to figure out how to use it yourself.")
|
||||
elif msg == 'yes' and status == '':
|
||||
politos.Say('Ok, good luck')
|
||||
politos.Map.TriggerConnected(1, 1)
|
||||
politos.WriteKey('opened', 'yes', 1)
|
||||
elif status != '':
|
||||
politos.Say('Feel free to go try get the keys now.')
|
||||
else:
|
||||
politos.Say(
|
||||
'Welcome to Darcap Manor. Here you can attempt to find some exclusive rewards!\n'
|
||||
'To get a treasure from upstairs, you need to find three keys: blue, white, brown.\n'
|
||||
'You can get one from each of the corners of this room, provided you are strong or smart enough, of course.\n'
|
||||
# 'If you go downstairs, you can attempt to get a random key, but you must be lucky.\n\n'
|
||||
'So do you wish to enter?'
|
||||
)
|
||||
Crossfire.SetReturnValue(1)
|
||||
|
||||
params = Crossfire.ScriptParameters()
|
||||
|
||||
if params == 'blue':
|
||||
blue_check()
|
||||
elif Crossfire.ScriptParameters() == 'potion':
|
||||
elif params == 'potion':
|
||||
potion_check()
|
||||
elif Crossfire.ScriptParameters() == 'kaptel':
|
||||
elif params == 'kaptel':
|
||||
kaptel_death()
|
||||
elif Crossfire.ScriptParameters() == 'white':
|
||||
elif params == 'white':
|
||||
white_challenge()
|
||||
elif params == 'reward':
|
||||
claim_reward()
|
||||
elif params == 'politos':
|
||||
politos()
|
||||
|
|
Loading…
Reference in New Issue