Giter Site home page Giter Site logo

uselessmine's Introduction

UselessMine

GitHub release Minimum BZFlag Version License

A BZFlag plug-in that allows players to convert the Useless flag into mines to kill other players simply by typing '/mine' while carrying a Useless flag.

The original plug-in was written by Enigma, then there was a more optimized rewrite released by sigonasr2, and lastly there is this rewrite. This implementation follows sigonasr2's implementation and is very similar in regards to how it works and the messages that are used during at deaths.

Compiling Requirements

  • BZFlag 2.4.14+
  • C++11

This plug-in follows my standard instructions for compiling plug-ins.

Usage

Loading the plug-in

This plug-in accepts the path to two text files containing death and defusal messages, respectively, when loaded.

Order matters when you're loading the plug-in, it must be death messages before defuse messages. If you'd like to skip death messages and only have defuseMessages, you may use the keyword NULL in place of a death messages file.

-loadplugin UselessMine.so[,UselessMine.deathMessages][,UselessMine.defuseMessages]

Custom Flags

Name Abbv Description
Bomb Defusal BD If carried over a mine's location, the mine will instead detonate at the owner's current location; points will be given to the player carrying the +BD flag.

Custom BZDB Variables

These custom BZDB variables can be configured with -set in configuration files and may be changed at any time in-game by using the /set command.

-set <name> <value>
Name Type Default Description
_mineSafetyTime int 5 The number of seconds a player has to leave the mine detonation radius if they accidentally spawn in it.

Note

Beginning with version 1.2.0 of the plug-in, the use of -setforced is no longer required; in fact, it's now discouraged.

Custom Slash Commands

Command Permission Description
/mine N/A Lay a mine
/minestats N/A Display the number of mines each player has on the field
/minecount N/A Display the total number of mines on the field
/reload setAll Reload all messages
/reload deathmessages setAll Reload the death messages
/reload defusalmessages setAll Reload the defusal messages

Custom Death/Defusal Messages file

These are optional files that will store all of the witty death/defusal messages announced when a player detonates or defuses a mine. If you would like death/defusal messages to be announced, you must give the plug-in the file.

In the file, each line is a separate death or defusal message. The supported placeholders are the following:

  • %victim% - The player who got killed by the mine; only available in death messages
  • %owner% - The player who placed the mine originally
  • %defuser% - The player who defused the mine; only available in defusal messages
  • %minecount% - The remaining amount of mines left on the field

The order in which you use the placeholders doesn't matter and the placeholders can be used several times in the same death message.

License

MIT

uselessmine's People

Contributors

allejo avatar asinck avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

asinck

uselessmine's Issues

Updates

  • Update compiling instructions
  • Make a release branch for latest stable
    • Possibly adopt git-flow?

Multi-kill Mines + Suicide

Two issues reported by thrak

the major issue that i am noticing atm is that %minecount% seems to be incrementing with each kill
there also seems to be an issue with scoring when owner kills more than a single player with same mine but that second issue seems more related to the server WW kill...

other item i noticed is suicide kill: when owner and victim both killed by mine. seems victim score should decrement -1 and owner score should be unchanged (+1 for kill, -1 for suicide... this is for single enemy only) however both scores are decremented -1

Reload death messages without plugin reload

Start a practice/convention of either /plugin uselessmine args... or /<pluginname> args... to add plugin specific functions.

Actions needed

  • Reload death messages without having to reload the plugin

Defusal Without Death

With respect to the ePlayerDieEvent here, before pull request.

I think that there might be an issue here. This case checks the mines when a player dies; this includes defused mines. In the typical case, this is fine: a player defuses a mine, and the mine goes off at the owner's location, the owner dies, and everything's nice. The problem would be if the defused mine SW goes off but doesn't kill the owner (for instance, if the owner is moving quickly or holding SH). When the owner does die, this message will trigger at that point, giving a seemingly random message. Note also that this means that the player won't get a message when the mine is defused, but when the owner dies.

A quick logic walkthrough:

Owner lays a mine, and hops on the tracks around the map.
Victim with BD runs over the mine, which triggers on the track.
The SW misses the owner, who proceeds to drop off the track and get shot.
Note that the mine was flagged as "defused", so when the ePlayerDieEvent triggers, the defused section will activate. The killer ID is set to the mine defuser, and the messages are sent.

So in summary, if the owner evades the defusal the messages will still be sent. I don't know if the points will be misassigned.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.