Finish turnbased combat tutorial text

This commit is contained in:
Griatch 2023-05-18 21:34:05 +02:00
parent f70fd64478
commit 09253dce31
10 changed files with 1393 additions and 106 deletions

View file

@ -101,12 +101,12 @@ You may want to use `ForeignKey` or `ManyToManyField` to relate your new model t
To do this we need to specify the app-path for the root object type we want to store as a string (we must use a string rather than the class directly or you'll run into problems with models not having been initialized yet).
- `"objects.ObjectDB"` for all [Objects](Objects) (like exits, rooms, characters etc)
- `"accounts.AccountDB"` for [Accounts](Accounts).
- `"scripts.ScriptDB"` for [Scripts](Scripts).
- `"comms.ChannelDB"` for [Channels](Channels).
- `"comms.Msg"` for [Msg](Msg) objects.
- `"help.HelpEntry"` for [Help Entries](Help-System).
- `"objects.ObjectDB"` for all [Objects](../Components/Objects.md) (like exits, rooms, characters etc)
- `"accounts.AccountDB"` for [Accounts](../Components/Accounts.md).
- `"scripts.ScriptDB"` for [Scripts](../Components/Scripts.md).
- `"comms.ChannelDB"` for [Channels](../Components/Channels.md).
- `"comms.Msg"` for [Msg](../Components/Msg.md) objects.
- `"help.HelpEntry"` for [Help Entries](../Components/Help-System.md).
Here's an example:
@ -225,4 +225,4 @@ To search your new custom database table you need to use its database *manager*
self.caller.msg(match.db_text)
```
See the [Beginner Tutorial lesson on Django querying](Beginner-Tutorial-Django-queries) for a lot more information about querying the database.
See the [Beginner Tutorial lesson on Django querying](../Howtos/Beginner-Tutorial/Part1/Beginner-Tutorial-Django-queries.md) for a lot more information about querying the database.

View file

@ -183,7 +183,7 @@ class EvAdventureCombatBaseHandler(DefaultScript):
combathandler_key = kwargs.pop("key", "combathandler")
combathandler = obj.ndb.combathandler
if not combathandler:
if not combathandler or not combathandler.id:
combathandler = obj.scripts.get(combathandler_key).first()
if not combathandler:
# have to create from scratch

View file

@ -1,7 +1,6 @@
# Twitch Combat
In this lesson we will build upon the basic combat framework we devised [in the previous lesson](./Beginner-Tutorial-Combat-Base.md).
In this lesson we will build upon the basic combat framework we devised [in the previous lesson](./Beginner-Tutorial-Combat-Base.md) to create a 'twitch-like' combat system.
```shell
> attack troll
You attack the Troll!
@ -48,7 +47,7 @@ You attack the troll with Sword: Roll vs armor(11):
The battle is over. You are still standing.
```
> Documentation doesn't show colors.
> Note that this documentation doesn't show in-game colors. If you are interested in an alternative, see the [next lesson](./Beginner-Tutorial-Combat-Turnbased.md), where we'll make a turnbased, menu-based system instead.
With "Twitch" combat, we refer to a type of combat system that runs without any clear divisions of 'turns' (the opposite of [Turn-based combat](./Beginner-Tutorial-Combat-Turnbased.md)). It is inspired by the way combat worked in the old [DikuMUD](https://en.wikipedia.org/wiki/DikuMUD) codebase, but is more flexible.
@ -942,11 +941,11 @@ This is what we need for a minimal test:
- An item (like a potion) we can `use`.
```{sidebar}
You can find an example batch-command script in [evennia/contrib/tutorials/evadventure/batchscripts/combat_demo.ev](evennia.contrib.tutorials.evadventure.batchscript)
You can find an example batch-command script in [evennia/contrib/tutorials/evadventure/batchscripts/twitch_combat_demo.ev](evennia.contrib.tutorials.evadventure.batchscripts)
```
While you can create these manually in-game, it can be convenient to create a [batch-command script](../../../Components/Batch-Command-Processor.md) to set up your testing environment.
> create a new subfolder `evadventure/batchscripts/` (if it doesn't exist)
> create a new subfolder `evadventure/batchscripts/` (if it doesn't already exist)
> create a new file `evadventure/combat_demo.ev` (note, it's `.ev` not `.py`!)
@ -1007,7 +1006,7 @@ set dummy/hp = 1000
Log into the game with a developer/superuser account and run
> batchcmd evadventure.batchscripts.combat_demo
> batchcmd evadventure.batchscripts.twitch_combat_demo
This should place you in the arena with the dummy (if not, check for errors in the output! Use `objects` and `delete` commands to list and delete objects if you need to start over. )

View file

@ -364,7 +364,7 @@ code {
/* padding: 1px 2px; */
font-size: 0.9em;
font-family: "Courier Prime", Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
font-weight: bold;
font-weight: normal;
background-color: #f7f7f7;
}