Two sets, mostly independent, but overlapping in Player.java
- CTF
- Fugitive/Follower
CTF Changes
-----------
data/conf/items/capturetheflag.xml
move flag to token item class, flag subclass
add arrows
data/sprites/items/ammunition/fumble_arrow.png
data/sprites/items/ammunition/slowdown_arrow.png
data/sprites/items/ammunition/speedup_arrow.png
new place-holder images for types of arrows (copies of wooden_arrow)
data/sprites/items/token/flag.png
new place-holder image for flag (copy of teddy)
src/games/stendhal/client/actions
TagClientAction.java - implement /tag on client side (copied from /tell)
SlashActionRepository.java - register /tag handler
/src/games/stendhal/common/constants
Nature.java - define two new natures
(this can be undone when a Weapon subclass of Item can have an effect
on entities. or if we just hack and look at the ammunition name)
src/games/stendhal/server/actions/chat
TagAction.java (new) handle /tag <player> [effect]
ChatAction.java - register TagAction
src/games/stendha/server/entity
RPEntity.java
import CaptureTheFlagFlag - support hack for droppable items
add Nature damageType to onDamaged() - supports deciding if
onDamaged handles fumble and slowdown when arrows used as normal weapons
added a speedModifier - will scale baseSpeed every turn. used for slowdown/recover/speedup
new methods
getDroppables()
dropDroppableItem(Item)
onDamagedFumble(Entity attacker, int damage)
maybeDropDroppables(attacker) called by TagAction - roll dice, possibly drop droppable
changeSpeed(double percentChange)
maybeSlowDown(attacker) called by TagAction - roll dice, possibly slow entity down temporarily
src/games/stendha/server/core/rp
StendhalRPAction.java - call to defender.onDamaged includes damage type
src/games/stendha/server/entity/mapstuff/area
DamagingArea.java call to defender.onDamaged includes damage type
LifeDrainArea.java call to defender.onDamaged includes damage type
src/games/stendha/server/player
Player.java added recoverSpeed()
XXX FollowingNPC stuff bleeds in
tests/games/stendha/server/entity
RPEntityTest.java - update onDamaged signature in a test subclass of RPEntity
Fugitive/Follower Changes
-------------------------
for any of these changes to be tested, you must update a zone xml file.
see below for an example.
src/games/stendhal/server/entity/npc
FollowingSpeakerNPC.java (new)
subclass of SpeakerNPC that follows a leader
startFollowing(Player)
stopFollowing(Player)
leaderMovedTo(Player, Zone, x, y)
TODO: factor Follower out - sheep, pets, ...
FugitiveNPC.java (new)
subclass of FollowingSpeakerNPC
reacts to being hit.
designed to easily support different personalities (toughness, ...)
NPCAttrUtils.java (new) helpers for configuring npc from bag of attrs
Player.java (note: should probably move these changes to RPEntity.java)
addFollower(FollowingSpeakerNPC follower)
add to list of followers
removeFollower(follower)
notifyMoved(Zone, x, y)
notify all followers that entity has moved to new location
overrides applyMovement to fire notifyMoved
src/games/stendhal/server/mapes/semos/hostel/FugitiveNPCSetup.java (new)
placeholder for setting up the Fugitive NPC with specified set of attributes.
probably should be moved to a new package - has nothing to do with the
hostel ...
To test/try out the fugitive/follower:
- add the following to semos.xml, and restart server
<configurator class-name="games.stendhal.server.maps.semos.hostel.FugitiveNPCSetup">
<parameter name="name">Fugitive</parameter>
<parameter name="description">On the Lamb</parameter>
<parameter name="x">19</parameter>
<parameter name="y">31</parameter>
<parameter name="direction">LEFT</parameter>
<parameter name="entityClass">chefnpc</parameter>
<parameter name="level">3</parameter>
<parameter name="atk">10</parameter>
<parameter name="def">10</parameter>
<!-- something about heal rate? -->
<parameter name="initHP">100</parameter>
<parameter name="pain-threshold">80</parameter>
</configurator>
- go to fugitive and attack (with a light weapon)
- should say ow, and eventually "i give up"
- say "follow"
- walk around. fugitive should follow you
- can even walk across zones, but they will immediately warp to where
you are
- say "stay"
- walk around. the fugitive will stay where they are
Anonymous
sorry, i forgot instructions on testing flag, arrows:
Testing CTF flag and arrows
best with two players - the carrier and the defender
# as an admin
/summon flag
- player1 picks up flag (can only go in l or r hand)
- should see teddy bear in hand, and balloon in outfit
/summonat player2 bag bow
/summonat player2 bag 100 fumble arrow
/summonat player2 bag 100 slowdown arrow
/summonat player2 bag 100 speedup arrow
- player2 equips bow and fumble arrows
- player2 can either attack player 1, or can "/tag player1"
- /tag fires exactly one arrow
- i have not figure out how to show the attack animation
- note that player1 will not automatically drop the flag
- both attacker and defender roll d20, and if attacker wins, carrier drops
- player2 equips slowdown arrows
- player2 tags player1 several times, and then player1 tries walking - should be slower,
and gradually recover to normal speed
- details: one arrow, if it hits, slows the target down 10%.
- players recover speed at 1% per second after that
- speedup arrows are available too, partly for testing, but maybe as
part of game strategy