Mercurial > hg > batmud > ggrtf
changeset 1244:c62e6c475bb2
Initial beastmaster module added, still very experimental and not meant for use.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 17 Oct 2010 17:25:26 +0000 |
parents | a81ce5b56a9f |
children | ac9360f5ac0a |
files | gm-bmaster.tf |
diffstat | 1 files changed, 112 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gm-bmaster.tf Sun Oct 17 17:25:26 2010 +0000 @@ -0,0 +1,112 @@ +;; +;; GgrTF::Beastmaster - Beastmaster guild support @ BatMUD +;; (C) Copyright 2010 Matti Hämäläinen (Ggr) +;; +;; This file (triggerset) is Free Software distributed under +;; GNU General Public License version 2. +;; +;; NOTICE! This file requires GgrTF (version 0.6.14 or later) to be loaded. +;; +/loaded GgrTF::Beastmaster +/test prdefmodule("Beastmaster") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Bindings +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;/prdefsbind -s"camp" -c"Camping" -n + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Fails and fumbles +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;/prdeffail -k -f -r -t"^You jump up and begin dancing, but you" +;/prdeffail -k -F -r -t"^You jump up and begin dancing, but after" +;/prdeffail -k -f -r -t"^You fail to start the fire." + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Mount handling +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +/def -i gbmaster_getmount =\ + /if ({#} > 0 & {1}!~"")\ + /let _mount=%{*}%;\ + /elseif (bmount_curr!~"")\ + /let _mount=%{bmount_curr}%;\ + /else \ + /let _mount=%{bmount_last}%;\ + /endif%;\ + /return gbmaster_short(_mount) + +/def -i gbmaster_short =\ + /let _mount=%{*}%;\ + /if (regmatch("^([A-Za-z ]+) [0-9]+$", _mount))\ + /let _mount=%{P1}%;\ + /endif%;\ + /echo short: '%{*}' -> '%{_mount}'%;\ + /return _mount + +/def -i -p1 -mregexp -t"^(.+?) gives you a big slobbery lick\.$" gbmaster_arrives =\ + /let _mount=%{P1}%;\ + /echo arrives: '%{_mount}'%;\ + /if (_mount =~ gbmaster_short(bmount_curr))\ + /test gbmaster_ride(_mount)%;\ + /else \ + /test gbmaster_lead(_mount)%;\ + /endif + +/def -i gbmaster_lead =\ + /set bmount_last=$[gbmaster_getmount({1})]%;\ + /if (bmount_last =~ gbmaster_short(bmount_curr))\ + @@dismount%;\ + /endif%;\ + @@lead %{bmount_last} + +/def -i gbmaster_ride =\ + /set bmount_last=$[gbmaster_getmount({1})]%;\ + /let _short=$[gbmaster_short(bmount_curr)]%;\ + /echo ride: '%{bmount_last}' '%{_short}'%;\ + /if (bmount_last =~ _short)\ + @@release%;\ + /endif%;\ + @@ride %{bmount_last} + +/def -i gbmaster_heel =\ + /if ({#} > 0 & {1}!~"")\ + /let _mount=%{*}%;\ + /elseif (bmount_curr!~"")\ + /let _mount=%{bmount_curr}%;\ + /endif%;\ + /set bmount_last=%{_mount}%;\ + @@use heel at %{_mount} + +/def -i ride = @@release $[gbmaster_short(bmount_curr)]%;/test gbmaster_ride({*}) +/def -i rele = @@release $[gbmaster_getmount({*})] +/def -i lead = /test gbmaster_lead({*}) +/def -i heel = /test gbmaster_heel({*}) +/def -i dis = @@dismount%;@@lead $[gbmaster_short(bmount_curr)] +/def -i store = @@dismount%;@@release%;@@store $[gbmaster_getmount({*})] + +/def -i rug =\ + /set bmount_last=$[gbmaster_getmount({*})]%;\ + @@party report Ride underground -> %{bmount_last}%;\ + @@use ride underground at %{bmount_last} + + +/def -i -mregexp -t" seems to perk up. It will now respond to:$|^This animal already responds to your call with the syntax:$" gbmaster_get_heel1 =\ + /set bmount_flag=1 + +/def -i -ag -Ebmount_flag -mregexp -t"^use heel at (.+)$" gbmaster_get_heel2 =\ + /set bmount_flag=0%;\ + /set bmount_curr=%{P1}%;\ + /msq @{BCwhite}Mount heel id@{n}: '@{BCgreen}%{bmount_curr}@{n}'. + + +/def -i gbmaster_remount =\ + /let _mount=$[gbmaster_short(bmount_curr)]%;\ + @@ride %{_mount}%;\ + @@lead %{_mount} + +/def -i -mregexp -t"^(You are knocked off your mount!|Your mount throws you!|Your annoyed mount throws you!)$" gbmaster_dismount =\ + /msr Thrown off mount!%;\ + /repeat -0.5 1 /gbmaster_remount +