Commit graph

34 commits

Author SHA1 Message Date
65f826c720 add lexical binding 2025-11-21 10:15:32 -06:00
29e97a496c fix typo 2025-11-21 10:14:35 -06:00
3c8241b07b updates to match my emacs settings 2025-11-21 10:12:16 -06:00
Howard Abrams
213391a54e Merge branch 'refactoring' into 'main'
♻️ Extract `rpgdm-core` and address deprecations

See merge request howardabrams/emacs-rpgdm!1
2023-12-10 20:15:03 +00:00
Jeremy Friesen
cf24af20b6 ♻️ Extract `rpgdm-core.el'
Prior to this commit, I experienced the following use case:

Given I have the following code:

```emacs-lisp
(require 'rpgdm-dice "~/git/emacs-rpgdm/rpgdm-dice.el")
(require 'rpgdm-tables "~/git/emacs-rpgdm/rpgdm-tables.el")
(require 'rpgdm-tables-dice "~/git/emacs-rpgdm/rpgdm-tables-dice.el")
(require 'rpgdm-tables-freq "~/git/emacs-rpgdm/rpgdm-tables-freq.el")

(setq rpgdm-base "~/git/emacs-rpgdm/")
```

And I call `rpgdm-tables-load`
And load all the tables.

When I then call `rpgdm-tables-choose`

Then I get the following error:

```
let*: Symbol’s function definition is void: rpgdm-message
```

With this commit I'm able to skip requiring `rpgdm` and thus only use a
segment of the `rpgdm` package ecosystem.
2023-12-10 10:52:34 -05:00
Jeremy Friesen
25c282c094 ♻️ Favor cl- functions
When requiring `rpgdm.el` and it's "child" packages, I encounter the
following warnings:

> Warning: ‘destructuring-bind’ is an obsolete alias (as of 27.1); use
> ‘cl-destructuring-bind’ instead.
>
> Warning: ‘incf’ is an obsolete alias (as of 27.1); use ‘cl-incf’
> instead.
>
> Warning: ‘decf’ is an obsolete alias (as of 27.1); use ‘cl-decf’
> instead.
>
> Warning: ‘defstruct’ is an obsolete alias (as of 27.1); use
> ‘cl-defstruct’ instead.

Since we've already required the `cl` package, this should be a noop change.
2023-12-10 09:56:04 -05:00
Howard Abrams
5c5f17e7a6 Reformatting and cleanup 2023-11-18 15:57:04 -08:00
Howard Abrams
14f6524eec Add any message to the standard kill-ring too.
You know, the clipboard!
2023-09-19 20:55:07 -07:00
Howard Abrams
1a99ec6539 Better description for a function. 2022-05-28 19:57:55 -07:00
Howard Abrams
b0c3601e4c Tables refer to other tables
If an entry in a table references <<another/table>>, that reference is
replaced with a call to that other table. This allows building complex responses.
2022-05-06 21:13:41 -07:00
Howard Abrams
769fcc27d4 Move the Ironsworn code to its own repo 2022-02-24 21:36:16 -08:00
Howard Abrams
71777f5792 Converting from f12 to f6
As the F12 adjusts the volume on a Mac. Sheesh.
2022-02-18 15:31:37 -08:00
Howard Abrams
8b89bf665b Add support for functions in the tables
This is still programmatic, as opposed to dynamically loading source code.
2022-02-18 15:26:48 -08:00
Howard Abrams
e570e9ccd0 Pulling the Ironsworn changes to its own repo 2022-02-18 15:26:48 -08:00
Howard Abrams
adacb01af6 Ironsworn interface changes
I am thinking I should pull this out into its own project.
2022-02-18 15:26:48 -08:00
Howard Abrams
ee447ab549 Playing around with specifying the base
This is to make it easier to load data that is stored with the project.
2022-02-18 15:26:31 -08:00
Howard Abrams
bdbc57448a Writing some unit tests for some of the functions. 2022-02-18 15:25:54 -08:00
Howard Abrams
5f68af3913 Switch to split-string
I have an idea to limit the number of libraries that I use, but I
don't know if that is really going to happen.
2022-02-18 15:25:14 -08:00
Howard Abrams
bb62828fb1 Yank the latest displayed message
When rolling on tables or dice, I may want to paste that into the
document I'm writing.
2022-02-18 15:25:14 -08:00
Howard Abrams
5455785b08 Like Athena, this project emerged fully formed from my head
At least, from this historical record as preserved by git, it is.
In reality, this project represents a year of off-and-on development
in another git repository, and has been converted and reformatted
for (potentially) public consumption.

Particularly lacking is the Tables and other charts that make this
useful, but I need to make sure I don't violate any copyright laws, as
many of my tables were copy/pasted from digital books I own.
2022-02-18 15:25:05 -08:00
Howard Abrams
1602a9b01d Fix a couple minor bugs
Which really make demoing this "product" difficult.

While I was at it, I split my "taverns" document into a number of real
tables that I could pull up.
2021-03-24 22:42:20 -07:00
Howard Abrams
520f74cc66 Re-roll the same dice expression.
Yes, I got that idea from d20, and at some point, we need to figure out
how to play better together.
2021-03-23 13:56:03 -07:00
Howard Abrams
a61dfcc201 Wide view for the Hydra
And changing the hotkey to F12 so that it is easier to access on the
laptop.

Oh, and let's have the displayed message contain a little more details
so that when we jump backwards through the history, we understand more
what we are seeing.
2021-03-23 13:46:50 -07:00
Howard Abrams
70586400a4 Delayed loading of Chart Tables
Because loading the tables is now getting time and space prohibited, we
are now just storing the the name of the table and the filename ... at
first. Then once we ask for a chart, we fetch the chart and choose some
results.

Loading the tables is now not a cost issue ... and Emacs more stable.
2021-03-23 13:43:36 -07:00
Howard Abrams
3da1174673 Fix table to return nil if table not found
This will make it easier for me to write functions to return values on
tables that may or may not exist.
2021-02-27 00:21:19 -08:00
Howard Abrams
07717c103d Change the "dashboard" screen to popups
I realized that a DM Screen isn't really what I want. If I want
information about a particular rule or the magic school, then I want it
to pop up, and then go away.
2021-02-27 00:20:43 -08:00
Howard Abrams
9719a29c3c Tables are now in a hierarchy
This should make creating NPC tables easier by grouping them.
2021-02-22 22:27:53 -08:00
Howard Abrams
656c168a52 Add dice tables
A dice table is a direct translation of a gaming table from a book,
where the table has a stated dice expression, and each entry has a
numeric range. Most tables can now be taken as is from published
sources.

Also, if a message from a randomly rolled table contains a dice
expression, like Found 2d8 scrolls, the expression is automatically
substituted.

Finally if a message contains something like:
  You found a [wolf/fox/badger].
The displayed message will only include on of those entries.
2021-02-11 22:08:06 -08:00
Howard Abrams
106ed2e6dd More random tables I've collected
Now, my players can run into a warehouse, or a library, and I won't be
stuck thinking about titles.
2021-02-11 21:57:50 -08:00
Howard Abrams
7dab533415 Working with both Dice and Frequency tables
Some of these tables are getting complicated, so I have created three
different tables, and this should be sufficient.

Describing it, however, seems to be a lot for source code, and I thought
I would describe it using a literate programming style. We'll see.
2021-02-08 15:26:16 -08:00
Howard Abrams
558d7eb984 Code functional with a good README and Interface
Wrote some reusable instructions as well as polished a minor mode and a
hydra for easily using the code. Time to try it out in production.
2021-02-01 17:52:40 -08:00
Howard Abrams
020d0386b7 Displayable tables of D&D 5th Edition
A collection of information I could easily remember that could be
displayed as part of a Dungeon Master Screen.
2021-01-29 23:29:57 -08:00
Howard Abrams
fd804c6424 A collection of tables for role playing
Some are particular to my campaigns, and others are just ideas I've collected.
2021-01-29 23:24:55 -08:00
Howard Abrams
9411e512ce After a night or two of late hacking...
I have a semblance of code giving me functions to help me run my D&D
games. The README needs a lot more love, but the code is generally tidy.

Time to add some tables...
2021-01-29 23:18:36 -08:00