Skip to content
Permalink
Browse files

VIETNAM

  • Loading branch information...
YogurtTheHorse committed Sep 28, 2016
1 parent d07d096 commit 47001f552a6fbb86839f9cc2b9aa2757876458ae
Showing with 218 additions and 114 deletions.
  1. +1 −1 items/loot/ak.py
  2. +1 −1 items/loot/m-16.py
  3. +1 −1 items/loot/m79.py
  4. +1 −1 items/loot/minigun.py
  5. +13 −0 items/loot/vietnam_star.py
  6. 0 rooms/{ → default}/boss/black_knight.py
  7. 0 rooms/{ → default}/boss/cthulhu.py
  8. 0 rooms/{ → default}/boss/hellkite_dragon.py
  9. 0 rooms/{ → default}/boss/lich_king.py
  10. 0 rooms/{ → default}/boss/moonlight_butterfly.py
  11. 0 rooms/{ → default}/boss/naping_dragon.py
  12. 0 rooms/{ → default}/missions/caravan/army.py
  13. 0 rooms/{ → default}/missions/caravan/caravan.py
  14. 0 rooms/{ → default}/missions/caravan/first.py
  15. 0 rooms/{ → default}/missions/lepricone/first.py
  16. 0 rooms/{ → default}/missions/main/first.py
  17. 0 rooms/{ → default}/missions/main/second.py
  18. 0 rooms/{ → default}/missions/main/third.py
  19. 0 rooms/{ → default}/monster/dragon.py
  20. 0 rooms/{ → default}/monster/easy/archemage.py
  21. 0 rooms/{ → default}/monster/easy/bat.py
  22. 0 rooms/{ → default}/monster/easy/duck.py
  23. 0 rooms/{ → default}/monster/easy/grass.py
  24. 0 rooms/{ → default}/monster/easy/minion.py
  25. 0 rooms/{ → default}/monster/easy/quinquepede.py
  26. 0 rooms/{ → default}/monster/easy/rat.py
  27. 0 rooms/{ → default}/monster/easy/slime.py
  28. 0 rooms/{ → default}/monster/easy/spirit.py
  29. 0 rooms/{ → default}/monster/easy/sylph.py
  30. 0 rooms/{ → default}/monster/easy/werewolf.py
  31. 0 rooms/{ → default}/monster/easy/zombie.py
  32. 0 rooms/{ → default}/monster/expert/saitama.py
  33. 0 rooms/{ → default}/monster/hard/basilisk.py
  34. 0 rooms/{ → default}/monster/hard/darklord.py
  35. 0 rooms/{ → default}/monster/hard/jayson.py
  36. 0 rooms/{ → default}/monster/hard/ork.py
  37. 0 rooms/{ → default}/monster/hard/vaper.py
  38. 0 rooms/{ → default}/monster/medium/bandits.py
  39. 0 rooms/{ → default}/monster/medium/bear.py
  40. 0 rooms/{ → default}/monster/medium/chubaka.py
  41. 0 rooms/{ → default}/monster/medium/dipper.py
  42. 0 rooms/{ → default}/monster/medium/ghoul.py
  43. 0 rooms/{ → default}/monster/medium/internet_troll.py
  44. 0 rooms/{ → default}/monster/medium/knight.py
  45. 0 rooms/{ → default}/monster/medium/mimic.py
  46. 0 rooms/{ → default}/monster/medium/mirror.py
  47. 0 rooms/{ → default}/monster/medium/nazgul.py
  48. 0 rooms/{ → default}/monster/medium/promote.py
  49. 0 rooms/{ → default}/monster/medium/rabbit.py
  50. 0 rooms/{ → default}/monster/medium/turtle.py
  51. 0 rooms/{ → default}/monster/up_medium/doctor_who.py
  52. 0 rooms/{ → default}/monster/up_medium/twi_monster.py
  53. 0 rooms/{ → default}/special/bill_cypher.py
  54. 0 rooms/{ → default}/special/bill_gates.py
  55. 0 rooms/{ → default}/special/gabe.py
  56. 0 rooms/{ → default}/special/icecream.py
  57. 0 rooms/{ → default}/special/kiba.py
  58. 0 rooms/{ → default}/special/kodzima.py
  59. 0 rooms/{ → default}/special/remains.py
  60. 0 rooms/{ → default}/special/rick_astley.py
  61. +3 −3 rooms/{ → default}/special/sign.py
  62. 0 rooms/{ → default}/special/stone_room.py
  63. 0 rooms/{ → default}/special/the_thing_from_below.py
  64. 0 rooms/{ → default}/special/tornament.py
  65. 0 rooms/{ → default}/special/yegorf1.py
  66. 0 rooms/{ → default}/usual/apple_tree.py
  67. 0 rooms/{ → default}/usual/call_back.py
  68. 0 rooms/{ → default}/usual/cesar.py
  69. 0 rooms/{ → default}/usual/chest.py
  70. +2 −2 rooms/{ → default}/usual/clairvoyance.py
  71. 0 rooms/{ → default}/usual/comissar.py
  72. 0 rooms/{ → default}/usual/destiny_book.py
  73. 0 rooms/{ → default}/usual/devil.py
  74. 0 rooms/{ → default}/usual/dog.py
  75. 0 rooms/{ → default}/usual/door.py
  76. 0 rooms/{ → default}/usual/dumbledore_office.py
  77. 0 rooms/{ → default}/usual/exit.py
  78. 0 rooms/{ → default}/usual/fog_door.py
  79. 0 rooms/{ → default}/usual/frog.py
  80. 0 rooms/{ → default}/usual/gideon.py
  81. 0 rooms/{ → default}/usual/gnome.py
  82. 0 rooms/{ → default}/usual/goal.py
  83. 0 rooms/{ → default}/usual/haircutter.py
  84. 0 rooms/{ → default}/usual/lepricone.py
  85. 0 rooms/{ → default}/usual/librarian.py
  86. 0 rooms/{ → default}/usual/lucifer_bank.py
  87. 0 rooms/{ → default}/usual/luck.py
  88. 0 rooms/{ → default}/usual/musclelot.py
  89. 0 rooms/{ → default}/usual/no_sudden_movement.py
  90. 0 rooms/{ → default}/usual/nothing.py
  91. 0 rooms/{ → default}/usual/orc_shop.py
  92. 0 rooms/{ → default}/usual/rick_and_morty.py
  93. +49 −0 rooms/default/usual/river.py
  94. 0 rooms/{ → default}/usual/roulette.py
  95. 0 rooms/{ → default}/usual/sensei.py
  96. 0 rooms/{ → default}/usual/shaolin_monastery.py
  97. 0 rooms/{ → default}/usual/slender.py
  98. 0 rooms/{ → default}/usual/some_player.py
  99. 0 rooms/{ → default}/usual/spanish_girl.py
  100. 0 rooms/{ → default}/usual/troll_bridge.py
  101. 0 rooms/{ → default}/usual/uncle_stanley.py
  102. 0 rooms/{ → default}/usual/vegan.py
  103. 0 rooms/{ → default}/usual/vladislav.py
  104. 0 rooms/{ → default}/usual/watches.py
  105. 0 rooms/{ → default}/usual/water.py
  106. 0 rooms/{ → default}/usual/witcher.py
  107. +0 −11 rooms/monster/vietnam/bush_soldier.py
  108. +0 −64 rooms/monster/vietnam/river.py
  109. +19 −15 rooms/roomloader.py
  110. +11 −0 rooms/vietnam/monster/bush_soldier.py
  111. +1 −1 rooms/{monster/vietnam → vietnam/monster}/hippie.py
  112. +16 −0 rooms/vietnam/monster/vietnam_army.py
  113. +46 −0 rooms/vietnam/usual/river.py
  114. +18 −0 rooms/vietnam/usual/trap.py
  115. +1 −1 tests.py
  116. +1 −0 user/__init__.py
  117. +1 −1 user/death_defenition.py
  118. +4 −4 user/fight_defenition.py
  119. +6 −6 user/room_defenition.py
  120. +23 −2 utils/buffs.py
@@ -1,6 +1,6 @@
name = 'АК-47'
description = (
' Пробивает рельс. Насвозь. Вдоль. Наверное.'
' Пробивает рельс. Насвозь. Вдоль. Наверное.'
)

price = 300
@@ -1,6 +1,6 @@
name = 'М-16'
description = (
'Приклад немного подплавился и треснул. _Держать вдали от воды!_'
'Приклад немного подплавился и треснул. _Держать вдали от воды!_'
)

price = 300
@@ -1,6 +1,6 @@
name = 'M79'
description = (
'Уничтожает. Быстро.'
'Уничтожает. Быстро.'
)

price = 800
@@ -1,6 +1,6 @@
name = 'Миниган'
description = (
'Тратит твои патроны. Быстро.'
'Тратит твои патроны. Быстро.'
)

price = 650
@@ -0,0 +1,13 @@
name = 'Мазь "Звёздочка"'
description = 'Лечебная мазь универсального действия. Кажется, может вылечить даже от рака.'
price = 300

usable = True
disposable = True

def on_use(user, reply):
reply('Вот так-то лучше!')

user.heal(25)

user.buffs = [ b for b in user.buffs if not b.is_negative() ]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -21,7 +21,7 @@ def get_actions(user):
actions = [ ]

for room_type, room_name in rooms:
loaded_room = roomloader.load_room(room_name, room_type)
loaded_room = roomloader.load_room(room_name, room_type, user)
name = loaded_room.name
if room_name not in all_visited_rooms:
name = crypt(name)
@@ -34,7 +34,7 @@ def enter(user, reply):

while len(rooms) < 4:
rm = roomloader.get_next_room(user)
loaded_room = roomloader.load_room(rm[1], rm[0])
loaded_room = roomloader.load_room(rm[1], rm[0], user)

if random.random() < 0.05:
rm = ('special', 'rick_astley')
@@ -47,7 +47,7 @@ def enter(user, reply):
def action(user, reply, text):
rooms = user.get_room_temp('rooms')
for room_type, room_name in rooms:
loaded_room = roomloader.load_room(room_name, room_type)
loaded_room = roomloader.load_room(room_name, room_type, user)
if loaded_room.name == text or crypt(loaded_room.name) == text:
if random.random() < 0.1:
reply('Что-то пошло не так, ты увидел фезку пролетающую у тебя над головой. Ощущения будто был нарушен межпространственный континуум.')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -56,7 +56,7 @@ def action(user, reply, text):
'И видит..\n'
)

room = roomloader.load_room(found_user.room[1], found_user.room[0])
room = roomloader.load_room(found_user.room[1], found_user.room[0], found_user)
room_name = room.name

res += room_name
@@ -66,7 +66,7 @@ def action(user, reply, text):
'И бросает кости в..\n'
)

room = roomloader.load_room(found_user.room[1], found_user.room[0])
room = roomloader.load_room(found_user.room[1], found_user.room[0], found_user)
room_name = room.name

res += room_name
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,49 @@
name = 'Река'


def get_actions(user):
return [ 'Грести', 'Вернуться в коридор' ]


def enter(user, reply):
reply(
'Дверь, через которую ты вошел, магическим образом исчезла.\n'
'Ты решаете осмотреться и замечаещь лодку, стоящую неподалёку.\n'
'Тебе ничего не остается, кроме как прыгнуть в речку и плыть. Да, всё именно так.\n'
'Хотя можно просто вернуться обратно в Джунгли..'
)
user.set_room_temp('rvr', 0)

def action(user, reply, text):
if text == 'Вернуться в коридор':
user.leave(reply)
return

rvr = user.get_room_temp('rvr', 0)

if user.has_item('m79') :
rvr += 4
reply('Ты вспоминаешь, что у тебя есть М79, берешь его в руки и гребешь.')
else:
rvr += 1
reply('Ты гребешь руками. Кажется, что скоро конец')

user.set_room_temp('rvr', rvr)

if rvr > 8:
msg = ''
if user.has_item('m-16'):
user.remove_item('m-16')
reply('Твой М-16 теперь не стреляет.. пришлость выкинуть.')


reply(
'Вы пристаете к другому концу берега, вылезаете из лодки.\n'
'Единственное место, куда вы можете пойти здесь - едва приоткрытая дверь.\n'
'Вы открываете дверь... И выходите во *Вьетнам*!\n\n'
'_Приключения начинаются_.\n\n'
'..._снова_.'
)

user.rooms_pack = 'vietnam'
user.leave(reply)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

This file was deleted.

This file was deleted.

@@ -10,7 +10,7 @@
logger = logging.getLogger('rg')

def load_room(name, room_type='usual', user=None):
path = 'rooms/{0}/{1}.py'.format(room_type, name)
path = 'rooms/{0}/{1}/{2}.py'.format(user.rooms_pack if user is not None else 'default', room_type, name)

if not os.path.exists(path):
path += 'c'
@@ -275,12 +275,13 @@ def get_next_room(user):
if p < 1 / 100:
return ('special', 'remains')
elif p <= 0.7:
return get_random_room('monster/' + user.level, user)
return get_random_room('monster/' + user.level, user, 'monster')
else:
return get_random_room('usual', user)

def get_all_rooms(room_type):
pth = 'rooms/' + room_type + '/'
def get_all_rooms(rooms_pack, room_type):
pth = 'rooms/' + rooms_pack + '/' + room_type + '/'

rooms = [ f[:-3] for f in os.listdir(pth) if f.endswith('.py') ]
comp_rooms = [ f[:-4] for f in os.listdir(pth) if f.endswith('.pyc') ]

@@ -291,7 +292,7 @@ def get_level_rooms(user, level):
names = [ ]
rm_type = 'monster/' + str(level)

for rm in get_all_rooms(rm_type):
for rm in get_all_rooms(user.rooms_pack, rm_type):
if rm in all_visited_rooms:
room = load_room(rm, rm_type, user)
names.append(room.name)
@@ -300,33 +301,36 @@ def get_level_rooms(user, level):

return names

def get_random_room(room_type, user):
rooms = get_all_rooms(room_type)
def get_random_room(room_type, user, second_type=None):
rooms = [ (room_type, rm) for rm in get_all_rooms(user.rooms_pack, room_type) ]

if second_type is not None:
rooms.extend([ (second_type, rm) for rm in get_all_rooms(user.rooms_pack, second_type) ])

all_visited_rooms = user.get_perma_variable('visited_rooms', [ ])

not_visited_rooms = [ ]
visited_rooms = [ ]

for rm in rooms:
for tp, rm in rooms:
if rm in all_visited_rooms:
visited_rooms.append(rm)
visited_rooms.append((tp, rm))
else:
not_visited_rooms.append(rm)
not_visited_rooms.append((tp, rm))

visited_rooms_proc = len(visited_rooms) / len(rooms)

if visited_rooms_proc < 1:
visit_new_p = 1 - visited_rooms_proc / 5

name = ''
new_room = ''

if random.random() < visit_new_p:
name = random.choice(not_visited_rooms)
new_room = random.choice(not_visited_rooms)
else:
name = random.choice(visited_rooms)
new_room = random.choice(visited_rooms)
else:
user.prepare_boss()
name = random.choice(rooms)
new_room = random.choice(rooms)

return (room_type, name)
return new_room
@@ -0,0 +1,11 @@
name = 'Куст'
hp = 280
damage_range = (20, 35)

coins = 200

loot = [ 'm-16' ]

def enter(user, reply):
reply('Когда ты проходил мимо куста, из него выпрыгнул солдат и ударил тебя прикладом')
user.make_damage(0, 30, reply, name='Приклад')
@@ -5,7 +5,7 @@

coins = 27

loot = [ 'grass_in_pot' ]
loot = [ 'vietnam_star' ]

def enter(user, reply):
reply('Он против войны. Докажи ему, что он не прав.')
@@ -0,0 +1,16 @@
import random

name = 'Армия Вьетнамцев'

hp = 1500
damage_range = ( 40, 70 )

coins = 1337

loot = [random.choice([ 'ak', 'm79' ])]

def enter(user, reply):
msg = (
'Огромая куча вьетнамцев, на летающих тракторах производства СССР, устроит дискотеку с фейерверком и светомузыкой. '
)
reply(msg)
@@ -0,0 +1,46 @@
name = 'Река'


def get_actions(user):
return [ 'Грести', 'Вернуться в джунгли' ]


def enter(user, reply):
reply(
'Ты решаете осмотреться и замечаещь лодку, стоящую неподалёку.\n'
'Тебе ничего не остается, кроме как прыгнуть в речку и плыть. Да, всё именно так.\n'
'Хотя можно просто вернуться обратно в Джунгли..'
)
user.set_room_temp('rvr', 0)

def action(user, reply, text):
if text == 'Вернуться в джунгли':
user.leave(reply)
return

rvr = user.get_room_temp('rvr', 0)

if user.has_item('m79') :
rvr += 4
reply('Ты вспоминаешь, что у тебя есть М79, берешь его в руки и гребешь.')
else:
rvr += 1
reply('Ты гребешь руками. Кажется, что скоро конец')

user.set_room_temp('rvr', rvr)

if rvr > 8:
msg = ''
if user.has_item('m-16'):
user.remove_item('m-16')
reply('Твой М-16 теперь не стреляет.. Пишлость выкинуть.')


reply(
'Вы пристаете к другому концу берега, вылезаете из лодки.\n'
'Единственное место, куда вы можете пойти здесь - едва приоткрытая дверь.\n'
'Вы открываете дверь... И выходите в Коридор!\n\n'
)

user.rooms_pack = 'default'
user.leave(reply)

0 comments on commit 47001f5

Please sign in to comment.
You can’t perform that action at this time.