mirror of
https://github.com/evennia/evennia.git
synced 2026-04-02 22:17:17 +02:00
Merge branch 'main' into evadventure_work
This commit is contained in:
commit
1f3d4ed840
23 changed files with 112 additions and 93 deletions
|
|
@ -100,7 +100,7 @@ If you try the `get` command, we will pick up the box. So far so good, but if we
|
|||
|
||||
lock box = get:false()
|
||||
|
||||
Locks represent a rather [big topic](../../../Components/Locks.md), but for now that will do what we want. This will lock the box so noone can lift it. The exception is superusers, they override all locks and will pick it
|
||||
Locks represent a rather [big topic](../../../Components/Locks.md), but for now that will do what we want. This will lock the box so no one can lift it. The exception is superusers, they override all locks and will pick it
|
||||
up anyway. Make sure you are quelling your superuser powers and try to get the box now:
|
||||
|
||||
> get box
|
||||
|
|
@ -142,7 +142,7 @@ You create your own scripts in Python, outside the game; the path you give to `s
|
|||
|
||||
## Pushing Your Buttons
|
||||
|
||||
If we get back to the box we made, there is only so much fun you can have with it at this point. It's just a dumb generic object. If you renamed it to `stone` and changed its description, noone would be the wiser. However, with the combined use of custom [Typeclasses](../../../Components/Typeclasses.md), [Scripts](../../../Components/Scripts.md)
|
||||
If we get back to the box we made, there is only so much fun you can have with it at this point. It's just a dumb generic object. If you renamed it to `stone` and changed its description, no one would be the wiser. However, with the combined use of custom [Typeclasses](../../../Components/Typeclasses.md), [Scripts](../../../Components/Scripts.md)
|
||||
and object-based [Commands](../../../Components/Commands.md), you could expand it and other items to be as unique, complex
|
||||
and interactive as you want.
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ Let's make us one of _those_!
|
|||
|
||||
create/drop button:tutorials.red_button.RedButton
|
||||
|
||||
The same way we did with the Script Earler, we specify a "Python-path" to the Python code we want Evennia to use for creating the object. There you go - one red button.
|
||||
The same way we did with the Script earlier, we specify a "Python-path" to the Python code we want Evennia to use for creating the object. There you go - one red button.
|
||||
|
||||
The RedButton is an example object intended to show off a few of Evennia's features. You will find that the [Typeclass](../../../Components/Typeclasses.md) and [Commands](../../../Components/Commands.md) controlling it are inside [evennia/contrib/tutorials/red_button](../../../api/evennia.contrib.tutorials.red_button.md)
|
||||
|
||||
|
|
@ -240,4 +240,4 @@ You will now find your new `History` entry in the `help` list and read your help
|
|||
|
||||
## Adding a World
|
||||
|
||||
After this brief introduction to building and using in-game commands you may be ready to see a more fleshed-out example. Evennia comes with a tutorial world for you to explore. We will try that out in the next lesson.
|
||||
After this brief introduction to building and using in-game commands you may be ready to see a more fleshed-out example. Evennia comes with a tutorial world for you to explore. We will try that out in the next lesson.
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ class EvAdventureRollEngine:
|
|||
defender_defense = getattr(defender, defense_type.value, 1) + 10
|
||||
result, quality = self.saving_throw(attacker, bonus_type=attack_type,
|
||||
target=defender_defense,
|
||||
advantage=advantave, disadvantage=disadvantage)
|
||||
advantage=advantage, disadvantage=disadvantage)
|
||||
|
||||
return result, quality
|
||||
```
|
||||
|
|
@ -584,8 +584,8 @@ class TestEvAdventureRuleEngine(BaseEvenniaTest):
|
|||
@patch("evadventure.rules.randint")
|
||||
def test_roll(self, mock_randint):
|
||||
mock_randint.return_value = 4
|
||||
self.assertEqual(self.roll_engine.roll("1d6", 4)
|
||||
self.assertEqual(self.roll_engine.roll("2d6", 2 * 4)
|
||||
self.assertEqual(self.roll_engine.roll("1d6", 4))
|
||||
self.assertEqual(self.roll_engine.roll("2d6"), 2 * 4)
|
||||
|
||||
# test of the other rule methods below ...
|
||||
```
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ are very dedicated.
|
|||
Many games, even the most roleplay-dedicated, thus tend to allow for players to mediate themselves
|
||||
to some extent. A common way to do this is to introduce *coded systems* - that is, to let the
|
||||
computer do some of the heavy lifting. A basic thing is to add an online dice-roller so everyone can
|
||||
make rolls and make sure noone is cheating. Somewhere at this level you find the most bare-bones
|
||||
make rolls and make sure no one is cheating. Somewhere at this level you find the most bare-bones
|
||||
roleplaying MUSHes.
|
||||
|
||||
The advantage of a coded system is that as long as the rules are fair the computer is too - it makes
|
||||
|
|
@ -236,4 +236,4 @@ Note how simple the command becomes and how generic you can make it. It becomes
|
|||
number of Combat commands by just extending this functionality - you can easily roll challenges and
|
||||
pick different skills to check. And if you ever decided to, say, change how to determine hit chance,
|
||||
you don't have to change every command, but need only change the single `roll_hit` function inside
|
||||
your `rules` module.
|
||||
your `rules` module.
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class NPCMerchant(Object):
|
|||
def open_shop(self, shopper):
|
||||
menunodes = {} # TODO!
|
||||
shopname = self.db.shopname or "The shop"
|
||||
EvMenu(shopper, menunodes, startnode="shop_start",
|
||||
EvMenu(shopper, menunodes, startnode="shopfront",
|
||||
shopname=shopname, shopkeeper=self, wares=self.contents)
|
||||
|
||||
```
|
||||
|
|
@ -215,7 +215,7 @@ class NPCMerchant(Object):
|
|||
"inspect_and_buy": node_inspect_and_buy
|
||||
}
|
||||
shopname = self.db.shopname or "The shop"
|
||||
EvMenu(shopper, menunodes, startnode="shop_start",
|
||||
EvMenu(shopper, menunodes, startnode="shopfront",
|
||||
shopname=shopname, shopkeeper=self, wares=self.contents)
|
||||
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue