Continue develop evadventure combat examples

This commit is contained in:
Griatch 2023-03-24 21:22:10 +01:00
parent db6d2bf4df
commit aa458dd1e9
4 changed files with 416 additions and 1431 deletions

View file

@ -0,0 +1,48 @@
# Evadventure combat demo
#
# Set up a combat area for testing combat. Requires developer or superuser perm.
#
# start from limbo
tel #2
# turn ourselves into a evadventure-character
type self = evennia.contrib.tutorials.evadventure.characters.EvAdventureCharacter
# assign us the twitch combat cmdset (requires superuser/developer perms)
py self.cmdset.add("evennia.contrib.tutorials.evadventure.combat.TwitchAttackCmdSet")
# Create and give us a weapons (this will use defaults on the class)
create sword:evennia.contrib.tutorials.evadventure.objects.EvAdventureWeapon
# dig a combat arena
dig arena:evennia.contrib.tutorials.evadventure.rooms.EvAdventureRoom = arena,back
# go to arena
arena
# allow combat in this room
set here/allow_combat = True
# create a dummy enemy to hit on
create/drop dummy puppet;dummy:evennia.contrib.tutorials.evadventure.npcs.EvAdventureMob
# describe the dummy
desc dummy = This is is an ugly training dummy made out of hay and wood.
# make the dummy crazy tough
dummy.hp_max = 1000
#
dummy.hp = 1000

File diff suppressed because it is too large Load diff

View file

@ -88,8 +88,8 @@ class EvAdventureDungeonRoom(EvAdventureRoom):
"""
allow_combat = True
allow_death = True
allow_combat = AttributeProperty(True, autocreate=False)
allow_death = AttributeProperty(True, autocreate=False)
# dungeon generation attributes; set when room is created
back_exit = AttributeProperty(None, autocreate=False)

View file

@ -11,7 +11,7 @@ just not be able to fight in them).
from copy import deepcopy
from evennia import DefaultCharacter, DefaultRoom
from evennia import AttributeProperty, DefaultCharacter, DefaultRoom
from evennia.utils.utils import inherits_from
CHAR_SYMBOL = "|w@|n"
@ -44,9 +44,9 @@ class EvAdventureRoom(DefaultRoom):
"""
allow_combat = False
allow_pvp = False
allow_death = False
allow_combat = AttributeProperty(False, autocreate=False)
allow_pvp = AttributeProperty(False, autocreate=False)
allow_death = AttributeProperty(False, autocreate=False)
def format_appearance(self, appearance, looker, **kwargs):
"""Don't left-strip the appearance string"""
@ -90,12 +90,11 @@ class EvAdventurePvPRoom(EvAdventureRoom):
"""
allow_combat = True
allow_pvp = True
allow_combat = AttributeProperty(True, autocreate=False)
allow_pvp = AttributeProperty(True, autocreate=False)
def get_display_footer(self, looker, **kwargs):
"""
Show if the room is 'cleared' or not as part of its description.
Customize footer of description.
"""
return "|yNon-lethal PvP combat is allowed here!|n"