Skip to content

Commit

Permalink
Merge pull request #366 from pedrouran/master
Browse files Browse the repository at this point in the history
Bureaucrats F7 HELP mesasges, and other minor improvements.
frandallfarmer authored Jul 22, 2020

Verified

This commit was signed with the committer’s verified signature. The key has expired.
midwan Dimitris Panokostas
2 parents defd27b + f097734 commit cf19919
Showing 2 changed files with 24 additions and 10 deletions.
4 changes: 2 additions & 2 deletions db/new_Downtown/Downtown_6i.json
Original file line number Diff line number Diff line change
@@ -236,7 +236,7 @@
{
"type": "item",
"ref": "item-Downtown_6i.bureaucrat2",
"name": "LicensesCrabot",
"name": "VottingsCrabot",
"in": "context-Downtown_6i",
"mods": [ {
"type" : "Bureaucrat",
@@ -263,7 +263,7 @@
{
"type": "item",
"ref": "item-Downtown_6i.bureaucrat3",
"name": "ComplaintsCrabot",
"name": "MessagesCrabot",
"in": "context-Downtown_6i",
"mods": [ {
"type" : "Bureaucrat",
30 changes: 22 additions & 8 deletions src/main/java/org/made/neohabitat/mods/Bureaucrat.java
Original file line number Diff line number Diff line change
@@ -110,20 +110,21 @@ public void bureaucrat_ASK(User from, OptString text) {
remainder = remainder.replace('{', '_');
if(remainder != "")
{
String actualTurf = avatar.turf.replace("_"," ");
if(remainder.toLowerCase().indexOf("context-")==0)
{
//Type this format: context-Aric_Ave_44_interior
String remainderPartial = remainder.substring(8);
remainderPartial.replace('-', '_');
object_say(from, "You lived in " + avatar.turf );
object_say(from, "You lived in " + actualTurf.substring(8) );
avatar.turf = "context-" + remainderPartial;
object_say(from, "You now live at " + avatar.turf );
object_say(from, "You now live at " + remainderPartial.replace('_', ' ') );
}
else
{
String DEFAULT_TURF = "context-test";
object_say(from, "You lived in " + avatar.turf );
avatar.turf = DEFAULT_TURF;

object_say(from, "You lived in " + actualTurf.substring(8) );
avatar.turf = Avatar.DEFAULT_TURF;
object_say(from, "Do you really want to live at " + remainder + "?, Let's see what I can do for you." );
}
}
@@ -137,7 +138,7 @@ public void bureaucrat_ASK(User from, OptString text) {
//object_say(from, noid, "I'm the PA bureaucrat. Please proceed your message with SEND:");
}
break;
case "licensescrabot":
case "vottingscrabot":
switch(command) {
case "CANDIDATE1:":
if(remainder.toLowerCase().equals("me")) {
@@ -183,7 +184,7 @@ else if(remainder.equals(candidate2)) {
bureaucrat_HELP(from, 1);
}
break;
case "complaintscrabot":
case "messagescrabot":
switch(command) {
case "COMPLAINT:":
if (remainder.length() > 0) {
@@ -248,7 +249,19 @@ public void bureaucrat_HELP(User from, int count) {

@JSONMethod
public void HELP(User from) {
generic_HELP(from);
String BureacratName = object().name().toLowerCase();
switch(BureacratName) {
case "propertycrabot":
send_reply_msg(from, "PROPERTY BUREAUCRAT: If you want to move to another turf, please talk to it starting with PROPERTY:");
break;
case "vottingscrabot":
send_reply_msg(from, "VOTING BUREAUCRAT: Say HELP to get a list of voting/registration options.");
break;
case "messagescrabot":
send_reply_msg(from, "MESSAGING BUREAUCRAT: Say HELP to get a list of messages you can send.");
break;
}

}

@Override
@@ -257,3 +270,4 @@ public void run() {
isRunning = false;
}
}

0 comments on commit cf19919

Please sign in to comment.