generic corp #167
Aliases: generic corp
85 verbs · 54 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
tell_money | this none this | rxd | #167 | 2 |
registered_msg | this none this | rxd | #167 | 1 |
enterfunc | this none this | rxd | #167 | 5 |
accept | this none this | rxd | #167 | 6 |
exitfunc | this none this | rxd | #167 | 4 |
log | this none this | rxd | #167 | 6 |
biz_log | this none this | rxd | #167 | 5 |
tree_tag | this none this | rxd | #167 | 14 |
announce | this none this | rxd | #167 | 10 |
make_forum | this none this | rxd | #167 | 17 |
record_shop_log_entry | this none this | rxd | #167 | 14 |
record_shop_sale | this none this | rxd | #167 | 2 |
record_shop_stock | this none this | rxd | #167 | 3 |
record_shop_removal | this none this | rxd | #167 | 3 |
record_shop_reprice | this none this | rxd | #167 | 2 |
create_channel | this none this | rxd | #167 | 10 |
founded_by | this none this | rxd | #167 | 5 |
biz_motd | this none this | rxd | #167 | 9 |
extend_offer | this none this | rxd | #167 | 8 |
biz_disband | this none this | rxd | #167 | 46 |
biz_deposit | this none this | rxd | #167 | 21 |
has_member | this none this | rxd | #167 | 2 |
biz_jingle | this none this | rxd | #167 | 11 |
render_chat | this none this | rxd | #167 | 19 |
active_players | this none this | rxd | #167 | 10 |
biz | any any any | rxd | #167 | 15 |
biz_rate | this none this | rxd | #167 | 18 |
tell_employees | this none this | rxd | #167 | 3 |
recycle | this none this | rxd | #167 | 17 |
biz_hide | this none this | rxd | #167 | 10 |
credit_receive | this none this | rxd | #167 | 14 |
announce_chat | this none this | rxd | #167 | 1 |
parse_color | this none this | rxd | #167 | 17 |
tell_info | this none this | rxd | #167 | 9 |
biz_chatcolor | this none this | rxd | #167 | 84 |
biz_contracts | this none this | rxd | #167 | 43 |
can_hire | this none this | rxd | #167 | 2 |
pay_hacker | this none this | rxd | #167 | 3 |
all_biz_for | this none this | rxd | #167 | 8 |
permit_control | this none this | rxd | #167 | 13 |
look_self | this none this | rxd | #167 | 3 |
pay_salaries | this none this | rxd | #167 | 17 |
heartbeat | this none this | rxd | #167 | 10 |
do_hire | this none this | rxd | #167 | 28 |
do_fire | this none this | rxd | #167 | 58 |
biz_summary | this none this | rxd | #167 | 2 |
summary | this none this | rxd | #167 | 55 |
biz_hire | any none none | rxd | #167 | 19 |
biz_employees | this none this | rxd | #167 | 16 |
disband_cleanup | this none this | rxd | #167 | 28 |
perm_check | this none this | rxd | #167 | 19 |
biz_help | this none this | rxd | #167 | 16 |
biz_withdraw | this none this | rxd | #167 | 22 |
level | this none this | rxd | #167 | 9 |
biz_fire | this none this | rxd | #167 | 15 |
biz_resign | none none none | rxd | #167 | 13 |
biz_promote | this none this | rxd | #167 | 27 |
biz_demote | this none this | rxd | #167 | 35 |
biz_access | this none this | rxd | #167 | 20 |
group_access | this none this | rxd | #167 | 25 |
employee_access | this none this | rxd | #167 | 29 |
biz_salary | this none this | rxd | #167 | 27 |
biz_listperms | this none this | rxd | #167 | 23 |
biz_sign | this none this | rxd | #167 | 0 |
biz_successor | this none this | rxd | #167 | 32 |
is_a_holder | this none this | rxd | #167 | 3 |
biz_takeover | this none this | rxd | #167 | 31 |
biz_shoplog | this none this | rxd | #167 | 18 |
biz_inactives | this none this | rxd | #167 | 23 |
is_holder | this none this | rxd | #167 | 1 |
biz_voteout | this none this | rxd | #167 | 75 |
do_disband | this none this | rxd | #167 | 0 |
old_cleanup | this none this | rxd | #167 | 19 |
_old_takeover | this none this | rxd | #167 | 34 |
rating | this none this | rxd | #167 | 1 |
raw_rating | this none this | rxd | #167 | 14 |
rating_grade | this none this | rxd | #167 | 5 |
title_for | this none this | rxd | #167 | 20 |
biz_shoprate | this none this | rxd | #167 | 19 |
credit_balance | this none this | rxd | #167 | 1 |
credit_charge | this none this | rxd | #167 | 10 |
biz_camchannel | this none this | rxd | #167 | 16 |
level_for | this none this | rxd | #167 | 17 |
is_dead | this none this | rxd | #167 | 9 |
systell | this none this | rxd | #167 | 1 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
company_name | #167 | rc | #361 | "Alastor's New Corp FO" |
symbol | #167 | rc | #361 | "" |
registered_msg | #167 | rc | #361 | list of 3{"Your business has been registered. Type 'corp' for more information on managing your company.", "", "As a CEO, you also now have access to the mailing list *forbes, for direct CEO-to-CEO communication. Just '@subscribe *forbes with notification'."} |
mapcolor | #167 | rc | #361 | "" |
motd | #167 | rc | #361 | "" |
takeover_wait | #167 | rc | #361 | 259200 |
log | #167 | rc | #361 | {} |
controlled_areas | #167 | rc | #361 | {} |
successor | #167 | rc | #361 | {} |
channel | #167 | rc | #361 | #-1 |
founded_at | #167 | rc | #361 | 0 |
founded_by | #167 | rc | #361 | #-1 |
hide_assets | #167 | rc | #361 | 0 |
levels | #167 | rc | #361 | list of 17{5, 0, 0, {"employees", 1}, {"shopkeeps", 7}, {"managers", 5}, 0, {"board", 10}, 0, 0, 0, 0, 0, 0, {"holders", 999}, 0, 0} |
ranks | #167 | rc | #361 | list of 17{5, 0, 0, {"employees", {}}, {"shopkeeps", {}}, {"managers", {}}, 0, {"board", {}}, 0, 0, 0, 0, 0, 0, {"holders", {}}, 0, 0} |
nonperm_commands | #167 | rc | #361 | {"summary", "help", "contracts", "resign", "takeover", "inactives", "voteout", "camchannel"} |
other_perms | #167 | rc | #361 | list of 9{"sign", "drop", "shopstock", "shopprice", "shopremove", "simprint", "crewhire", "crewfire", "simuse"} |
unwanted_vote_task | #167 | rc | #361 | 0 |
gangsign | #167 | r | #361 | "" |
credit | #167 | rc | #361 | 0 |
warehouse | #68 | r | #29 | <clear> |
help_msg | #68 | rc | #361 | list of 30{"$biz:level(who)", "returns the highest level (numerical).", "", "$biz:is_holder(who)", "Returns a non-zero value if who is a holder.", "", "$biz:perm_check(who, command)", "Checks to see if who has the appropiate rank or perms to execute command. Command has to be in .biz_commands or .other_perms. If it's something like signing contracts and it's not an actual command on the biz FO, put it in .other_perms and not .biz_commands so it won't show up on 'corp help'.", "", "$biz.successor", "Stores the list of successors that will ascend to CEO-hood when the last remaining CEO resigns.", "", "$biz.levels", "Stores the ranks, and the numberical \"level\" of the rank.", "example: [\"employees\" -> 1, \"managers\" -> 5, \"board\" -> 10, \"holders\" -> 999]", "", "$biz.ranks", "Also stores the ranks, and who is in them. It's a ladder system so if an employee is in holders, he's in all groups between employees (level 1) and holders (level 999). It's a hash with the names of the ranks as the key. The value of the keys are lists- with the object numbers.", "example: [\"employees\" -> {#413632, #364606, #275227, #241289, #349965, #274396}, \"managers\" -> {#413632, #364606, #275227, #241289, #349965}, \"board\" -> {#413632, #364606, #275227, #349965}, \"holders\" -> {#364606, #413632, #275227 #349965}]", "", "Admins can add levels at will: to add, just add the rank -> number in .levels and rank -> {} in .ranks.", "", "$biz.nonperm_commands", "Commands that are available to all employees. Right now it's {\"summary\", \"help\", \"contracts\", \"resign\"}.", "", "$biz.biz_commands", "Commands that require perms, and have a matching :biz_cmd on the $biz object.", "", "$biz:biz_salary", "A command that allows someone with perms to set a salary between 0 and 20000 for an employee. 0 will remove the salary."} |
feature_verbs | #68 | r | #29 | {} |
feature_ok | #68 | r | #29 | <clear> |
handed | #5 | rc | #361 | <clear> |
wield_msg | #5 | rc | #361 | <clear> |
unwield_msg | #5 | rc | #361 | <clear> |
size | #5 | rc | #361 | <clear> |
look_place_msg | #5 | rc | #361 | <clear> |
value | #5 | rc | #361 | <clear> |
get_msg | #5 | rc | #361 | <clear> |
drop_msg | #5 | rc | #361 | <clear> |
get_fail_msg | #5 | rc | #361 | <clear> |
junk_ok | #5 | rc | #361 | <clear> |
floats | #5 | rc | #361 | <clear> |
long_name_msg | #5 | rc | #361 | <clear> |
article | #5 | rc | #361 | <clear> |
setup_list | #5 | rc | #361 | <clear> |
health | #5 | rc | #361 | <clear> |
health_max | #5 | rc | #361 | <clear> |
min_skill | #5 | rc | #361 | <clear> |
skill | #5 | rc | #361 | <clear> |
recipe_for | #5 | rc | #361 | <clear> |
carried_msg | #5 | rc | #361 | <clear> |
aliases | #1 | rc | #361 | {"generic corp"} |
description | #1 | rc | #361 | "The new biz object, as made by Alastor." |
object_size | #1 | r | #29 | {81712, 1298434195} |
hidden_verbs | #1 | rc | #361 | list of 11{"hold", "stow", "@setup", "throw", "give", "junk", "appraise", "stash", "feed", "breakdown", "improvise"} |
phelp_msg | #1 | rc | #361 | <clear> |
weight | #1 | rc | #361 | 100 |
owner_verbs | #1 | rc | #361 | <clear> |
plural_name | #1 | rc | #361 | <clear> |
client_image | #1 | rc | #361 | <clear> |
listening | #1 | rc | #361 | <clear> |
Ancestry
Ancestors (nearest first): #68 Generic Feature Object → #5 generic thing → #1 root
Children: none
Call graph
Showing 48 of 113 verbs; 65 not shown.
Source
tell_money
Referenced by
- #167:look_self line 3:
this:tell_money
Source
1{?who = player} = args; 2who:tell(this.company_name, " holds ", $ansi.bold_on + $ansi.green, "$", this.credit, $ansi.reset, " in credit.");
registered_msg
Referenced by
none
Source
1return this.registered_msg;
enterfunc
Referenced by
none
Source
1what = args[1]; 2if (is_a(what, $contract)) 3this:announce(("Accepted contract '" + what.name) + "'."); 4what:accepted_by(this); 5endif
accept
Referenced by
none
Source
1what = args[1]; 2if (is_a(what, $contract)) 3if (!what:cant_add_to(this)) 4return 1; 5endif 6endif
exitfunc
Referenced by
none
Source
1what = args[1]; 2if (is_a(what, $contract)) 3this:announce(("Lost contract '" + what.name) + "'."); 4endif
log
Referenced by
- #167:biz_disband line 13:
this:log - #167:biz_deposit line 15:
this:log - #167:biz_rate line 15:
this:log - #167:do_hire line 13:
this:log - #167:do_fire line 48:
this:log - #167:do_fire line 52:
this:log - #167:biz_withdraw line 14:
this:log - #167:biz_promote line 22:
this:log - #167:biz_demote line 30:
this:log - #167:group_access line 15:
this:log - #167:group_access line 21:
this:log - #167:employee_access line 15:
this:log - #167:employee_access line 25:
this:log - #167:biz_salary line 19:
this:log - #167:biz_salary line 26:
this:log - #167:biz_successor line 12:
this:log - #167:biz_successor line 21:
this:log - #167:biz_takeover line 30:
this:log - #167:biz_voteout line 37:
this:log - #167:biz_voteout line 58:
this:log - #167:biz_voteout line 64:
this:log - #167:_old_takeover line 30:
this:log - #167:biz_shoprate line 16:
this:log - #167:biz_camchannel line 13:
this:log
Source
1entry = $su:from_list(args, ""); 2entry = ($time:ctime() + ": ") + entry; 3this.log = {@this.log, entry}; 4if (length(this.log) > 30) 5this.log = this.log[$ - 29..$]; 6endif
biz_log
Referenced by
none
Source
1"Show the company's financial transaction log."; 2player:tell($ansi.bold_on, "Most recent log entries for ", this.company_name, ":", $ansi.reset); 3player:tell("---------------------------------------------------------------------------"); 4player:tell_lines(this.log); 5player:tell("---------------------------------------------------------------------------");
tree_tag
Referenced by
none
Source
1r = ""; 2if (this.symbol) 3r = tostr(r, " ", $su:left(tostr(this.symbol), -6)); 4endif 5if (!this.f) 6r = tostr(r, " ", this:rating(), "%"); 7if (rating = this:rating_grade()) 8r = tostr(r, " ", rating[1]); 9endif 10if (this.credit) 11r = tostr(r, " ", $ansi.green, "$", $su:group_number(this.credit), $ansi.reset); 12endif 13endif 14return r;
announce
Referenced by
- #167:enterfunc line 3:
this:announce - #167:exitfunc line 3:
this:announce - #167:biz_motd line 6:
this:announce - #167:biz_disband line 12:
this:announce - #167:biz_disband line 20:
this:announce - #167:biz_disband line 29:
this:announce - #167:biz_rate line 14:
this:announce - #167:do_hire line 12:
this:announce - #167:do_fire line 24:
this:announce - #167:do_fire line 36:
this:announce - #167:do_fire line 47:
this:announce - #167:do_fire line 51:
this:announce - #167:biz_promote line 21:
this:announce - #167:biz_demote line 29:
this:announce - #167:biz_successor line 10:
this:announce - #167:biz_successor line 19:
this:announce - #167:biz_takeover line 29:
this:announce - #167:biz_voteout line 24:
this:announce - #167:biz_voteout line 28:
this:announce - #167:biz_voteout line 36:
this:announce - #167:biz_voteout line 43:
this:announce - #167:biz_voteout line 57:
this:announce - #167:biz_voteout line 61:
this:announce - #167:biz_voteout line 63:
this:announce - #167:_old_takeover line 29:
this:announce - #167:biz_shoprate line 15:
this:announce - #167:biz_camchannel line 12:
this:announce - #167:systell line 1:
this:announce
Source
1if (!is_a(this.channel, $biznet)) 2rendered = this:render_chat(#2, $su:from_list(args, ""), 1); 3else 4rendered = this.channel:_render(#2, $su:from_list(args, ""), 1); 5endif 6for x in (this.ranks["employees"]) 7if (is_connected(x)) 8x:tell(rendered); 9endif 10endfor
make_forum
Referenced by
- #167:create_channel line 10:
this:make_forum - #167:do_hire line 26:
this:make_forum
Source
1if (!is_a(this.forum, #337224)) 2forum = $recycler:_create(#337224); 3forum.name = "c-" + this.symbol; 4forum.aliases = {forum.name}; 5forum:moveto($mail_agent); 6forum.biz = this; 7this.forum = forum; 8else 9forum = this.forum; 10endif 11for x in (this.ranks["employees"]) 12if (is_player(x)) 13player = x; 14x:("@subscribe")("*" + forum.name); 15endif 16endfor 17return forum;
record_shop_log_entry
Referenced by
- #167:record_shop_sale line 2:
this:record_shop_log_entry - #167:record_shop_stock line 2:
this:record_shop_log_entry - #167:record_shop_removal line 2:
this:record_shop_log_entry - #167:record_shop_reprice line 2:
this:record_shop_log_entry
Source
1":record_shop_log_entry(shop, text) => Record 'text' in the log for 'shop'."; 2{shop, text} = args; 3"Only retain log entries for a real-life week at most..."; 4entry_lifetime = (((60 * 60) * 24) * 7) * 8; 5time = $time:time(); 6if (index = $lu:iassoc(shop, this.shop_logs)) 7log = this.shop_logs[index][2]; 8while (log && ((time - log[1][1]) > entry_lifetime)) 9log = listdelete(log, 1); 10endwhile 11this.shop_logs[index][2] = listappend(log, {time, text}); 12else 13this.shop_logs = listappend(this.shop_logs, {shop, {{time, text}}}); 14endif
record_shop_sale
Referenced by
none
Source
1{shop, item, buyer, price} = args; 2this:record_shop_log_entry(shop, $su:ps(tostr("%DN bought %it for $", price, "."), buyer, item));
record_shop_stock
Referenced by
none
Source
1{shop, item, remover} = args; 2this:record_shop_log_entry(shop, $su:ps(tostr("%DN stocked the case with %it."), remover, item)); 3this.shop_stockers[item] = remover;
record_shop_removal
Referenced by
none
Source
1{shop, item, remover} = args; 2this:record_shop_log_entry(shop, $su:ps(tostr("%DN removed %it from the case."), remover, item)); 3this.shop_stockers = hashremove(this.shop_stockers, item);
record_shop_reprice
Referenced by
none
Source
1{shop, item, repricer, newprice} = args; 2this:record_shop_log_entry(shop, $su:ps(tostr("%DN set the price of %it to $", newprice, "."), repricer, item));
create_channel
Referenced by
- #167:founded_by line 2:
this:create_channel
Source
1if (!is_a(this.channel, $biznet)) 2channel = $recycler:_create($biznet); 3channel:set_name("broadcast channel for " + this.symbol); 4channel:set_aliases({"broadcast channel for " + this.symbol}); 5channel.biz = this; 6$wiz_utils:set_owner(channel, #2); 7channel:moveto(#34723); 8this.channel = channel; 9endif 10this:make_forum();
founded_by
Referenced by
none
Source
1holder = args[1]; 2this:create_channel(); 3holder:add_feature(this.channel); 4this.founded_by = holder; 5this.founded_at = time();
biz_motd
Referenced by
none
Source
1"motd <text> - Set your company's Message Of The Day."; 2if (args) 3text = $su:from_list(args, " "); 4this.motd = text; 5player:tell("You set your company's MOTD to: \"", text, "\""); 6this:announce(((player:name() + " has changed the MOTD to: \"") + text) + "\""); 7else 8player:tell("The usage is 'corp motd <text>'."); 9endif
extend_offer
Referenced by
- #167:biz_hire line 13:
this:extend_offer
Source
1who = args[1]; 2if (player == who) 3return player:tell("Jerk."); 4endif 5this.offers[who] = {time(), player}; 6who:systell($ansi.bold_on, this.company_name, " (", this.symbol, ") ", $ansi.bold_off, "is offering you a job."); 7who:systell("To accept it, type '", $ansi.bold_on, "join ", this.symbol, "'", $ansi.bold_off, "."); 8who:systell("The job offer will expire in 24 hours.");
biz_disband
Referenced by
none
Source
1"Go out of business."; 2holders = ((this.ranks["employees"] == 1) && (!this.ranks["holders"])) ? this.ranks["employees"] | this.ranks["holders"]; 3if (!(player in holders)) 4player:tell("You can only disband a corp if you own it part of the corp."); 5return; 6elseif ((length(holders) > 1) && (this.disband_votes == {})) 7if (!$cu:yes_or_no(("Are you SURE you want to disband '" + this.company_name) + "'?")) 8return; 9endif 10this.disband_votes = {player}; 11player:tell("You have started a disband vote. Informing all other holders. Vote ends in 5 minutes."); 12this:announce(player:dnamec() + " has started a vote to disband the corp. Vote ends in 5 minutes."); 13this:log(player:dnamec() + " started a disband vote."); 14for holder in (setremove(holders, player)) 15holder:tell(player:dnamec() + " has started a vote to disband the corp. Type 'corp disband' to accept. Ending in 5 minutes."); 16endfor 17fork (300) 18if ($recycler:valid(this) && is_a(this, $biz)) 19this.disband_votes = {}; 20this:announce("Disband vote ended. Corp will not disband."); 21endif 22endfork 23elseif (player in this.disband_votes) 24player:tell("You already voted to disband."); 25elseif ((length(holders) > 1) && (length(this.disband_votes) < (length(holders) - 2))) 26if (!$cu:yes_or_no(("Are you SURE you want to disband '" + this.company_name) + "'?")) 27return; 28endif 29this:announce(player:dnamec() + " has voted to disband."); 30player:tell("You've voted to disband the corp."); 31this.disband_votes = {@this.disband_votes, player}; 32else 33if (!$cu:yes_or_no(("Are you SURE you want to disband '" + this.company_name) + "'?")) 34return; 35endif 36player:tell("You have now given up all claims on ", this:dname(), "."); 37for contract in (this:occupants($contract)) 38contract:expire(); 39endfor 40shared = this.credit / length(holders); 41for holder in (holders) 42this:credit_transfer(holder, shared); 43endfor 44this:disband_cleanup(); 45$recycler:_recycle(this); 46endif
biz_deposit
Referenced by
none
Source
1"Deposit credit from your personal account into the business."; 2if (!args) 3player:tell("Deposit how much?"); 4return; 5endif 6amount = toint(args[1]); 7if (amount < 0) 8player:tell("Nice try, you can only deposit positive amounts of money."); 9return; 10endif 11if (amount) 12if (amount <= player.credit) 13player:credit_transfer(this, amount); 14player:tell("You deposited ", $ansi.green, "$", amount, $ansi.reset, " into ", this.name, "."); 15this:log(((("$" + tostr(amount)) + " deposited by ") + player.name) + "."); 16elseif (amount > player.credit) 17player:tell("You only have ", $ansi.green, "$", player.credit, $ansi.reset, "."); 18endif 19else 20player:tell("Usage: biz deposit <amount>"); 21endif
has_member
Referenced by
none
Source
1confirm = (args[1] in this.ranks["employees"]) ? 1 | 0; 2return confirm;
biz_jingle
Referenced by
none
Source
1"jingle <text> - Set your company's jingle."; 2if (args) 3text = $su:from_list(args, " "); 4if (length(text) > 200) 5return player:tell("That is too long for a jingle. Please limit your jingle to 200 characters or less."); 6endif 7this.jingle_msg = text; 8player:tell("You set your company jingle to: \"", text, "\""); 9else 10player:tell("The usage is 'corp jingle <text>'."); 11endif
render_chat
Referenced by
- #167:announce line 2:
this:render_chat
Source
1verbatim = 0; 2if (length(args) > 2) 3verbatim = args[3]; 4endif 5msg = args[2]; 6who = args[1]; 7rendered = ((((((($ansi.bold_on + $ansi.cyan) + "[ ") + this.symbol) + " ]") + $ansi.white) + ":") + $ansi.reset) + " "; 8if (verbatim) 9rendered = ((rendered + $ansi.bold_on) + $ansi.yellow) + msg; 10else 11rendered = (rendered + $ansi.bold_on) + $ansi.purple; 12if (msg && (msg[1] == ":")) 13rendered = (rendered + (who:real_name() + " ")) + msg[2..$]; 14else 15rendered = rendered + $english_utils:quote(who, msg, 1); 16endif 17endif 18rendered = rendered + $ansi.reset; 19return rendered;
active_players
Referenced by
- #167:raw_rating line 6:
this:active_players
Source
1a = 0; 2"for p in ($lu:remove_duplicates($lu:flatten(values(this.ranks))))"; 3for p in (this.ranks["employees"]) 4if (is_player(p)) 5if ((p.last_connect_time > p.last_disconnect_time) || ((time() - p.last_disconnect_time) < (86400 * 7))) 6a = a + 1; 7endif 8endif 9endfor 10return a;
biz
Referenced by
none
Source
1if (args) 2cmd = args[1]; 3commands = {@this.biz_commands, @this.nonperm_commands}; 4cmd = $su:match_stringlist(cmd, commands); 5if (!cmd) 6cmd = "help"; 7else 8cmd = commands[cmd]; 9endif 10else 11cmd = "summary"; 12endif 13args = (length(args) > 1) ? args[2..$] | {}; 14player:tell(""); 15this:("biz_" + cmd)(@args);
biz_rate
Referenced by
none
Source
1"Check or set the rate on commissions paid to employees."; 2if (args) 3try 4rate = tofloat(tostr(args[1])); 5rate = tofloat(toint(rate * 100.0)) / 100.0; 6except (E_INVARG) 7player:tell("Try a real number, dickhead."); 8return; 9endtry 10if ((rate < 0.0) || (rate > 1.0)) 11player:tell("The pay rate must be between 0.0 (no pay) and 1.0 (full commission, no profit to the business)."); 12else 13this.pay_rate = rate; 14this:announce("The pay rate has been changed to ", tostr(rate), " by ", player:name(), "."); 15this:log(((("Pay rate changed to " + tostr(rate)) + " by ") + player:name()) + "."); 16endif 17endif 18player:tell($ansi.yellow, $ansi.bold_on, "Current pay rate for ", this.company_name, " (", this.symbol, ") is ", $ansi.green, this.pay_rate, $ansi.yellow, ".", $ansi.reset);
tell_employees
Referenced by
- #167:look_self line 2:
this:tell_employees - #167:biz_hire line 18:
this:tell_employees - #167:biz_promote line 26:
this:tell_employees - #167:biz_demote line 34:
this:tell_employees
Source
1who = args[1]; 2who:tell("Employee list:"); 3who:tell(" ", $su:english_list($lu:map_prop(this.ranks["employees"], "name")));
recycle
Referenced by
none
Source
1for x in (this.ranks["employees"]) 2x.employer = #-1; 3endfor 4for x in (this.contents) 5x:expire(); 6$cu:sin(); 7endfor 8if (is_a(this.channel, $biznet)) 9$recycler:_recycle(this.channel); 10endif 11if (is_a(this.forum, #1)) 12$recycler:_recycle(this.forum); 13endif 14if (this in #304727.subscribed_corps) 15#304727.subscribed_corps = setremove(#304727.subscribed_corps, this); 16endif 17return pass(@args);
biz_hide
Referenced by
none
Source
1"Toggle between hiding and revealing company assets to employees."; 2if (this.hide_assets == 0) 3player:tell($ansi.bold_on, $ansi.yellow, "[ Hiding company assets from employee view. ]", $ansi.reset); 4this.hide_assets = 1; 5elseif (this.hide_assets == 1) 6player:tell($ansi.bold_on, $ansi.yellow, "[ Showing company assets to employee view. ]", $ansi.reset); 7this.hide_assets = 0; 8else 9#388:tell("WHAT THE!?"); 10endif
credit_receive
Referenced by
none
Source
1{amount, payer} = args; 2if (amount < 0) 3raise(E_INVARG, "amount can't be negative", amount); 4endif 5cap = 1000000000; 6if (this.credit > cap) 7this.credit = cap; 8return; 9endif 10if ((max = cap - this.credit) < amount) 11amount = max; 12endif 13this.credit = this.credit + amount; 14return amount;
announce_chat
Referenced by
none
Source
1this.channel:announce(@args);
parse_color
Referenced by
- #167:biz_chatcolor line 32:
this:parse_color
Source
1colors = {"red", "green", "yellow", "blue", "purple", "cyan", "white"}; 2color = $ansi.white; 3bold = 0; 4for arg in (args) 5arg = $su:trim($su:lowercase(arg)); 6if (arg in colors) 7color = $ansi.(arg); 8elseif (arg == "bold") 9bold = 1; 10else 11return 0; 12endif 13endfor 14if (bold) 15return $ansi.bold_on + color; 16endif 17return color;
tell_info
Referenced by
- #167:summary line 5:
this:tell_info - #167:summary line 6:
this:tell_info - #167:summary line 8:
this:tell_info - #167:summary line 10:
this:tell_info - #167:summary line 13:
this:tell_info - #167:summary line 28:
this:tell_info - #167:summary line 32:
this:tell_info - #167:summary line 34:
this:tell_info - #167:summary line 35:
this:tell_info - #167:summary line 36:
this:tell_info - #167:summary line 37:
this:tell_info - #167:summary line 38:
this:tell_info - #167:summary line 39:
this:tell_info - #167:summary line 40:
this:tell_info - #167:summary line 49:
this:tell_info - #167:summary line 54:
this:tell_info - #167:biz_inactives line 22:
this:tell_info
Source
1who = args[1]; 2what = args[2]; 3rest = tostr(@args[3..$]); 4align = 20; 5if (length(what) == align) 6prefix = what + ": "; 7endif 8prefix = $su:left(what + " ", align - 1, ".") + ": "; 9who:tell($ansi.white, $ansi.bold_on, prefix, $ansi.reset, rest);
biz_chatcolor
Referenced by
none
Source
1"Adjusts the colors for the company's broadcast network."; 2if (!is_a(this.channel, $biznet)) 3player:tell("Uhoh. Your company's broadcast channel seems to be missing. Contact an admin."); 4return; 5endif 6if (!args) 7mode = "invalid"; 8args = {}; 9else 10mode = args[1]; 11args = args[2..$]; 12endif 13colors = {"red", "green", "yellow", "blue", "purple", "cyan", "white"}; 14colors = $lu:sort(colors); 15levels = keys(this.levels); 16levels_color = {}; 17for rank in (levels) 18levels_color = {@levels_color, rank + "_color"}; 19endfor 20colormodes = {"identifier", @levels, "default", "other"}; 21if (mode in colormodes) 22map = {"color", @levels_color, "speech_color", "verbatim_color"}; 23prop = map[mode in colormodes]; 24if (!args) 25if ($ou:has_property(this.channel, prop)) 26color = this.channel.(prop); 27player:tell((((("Color is currently set to " + $ansi.reset) + color) + "example") + $ansi.reset) + "."); 28else 29player:tell("Color is default right now."); 30endif 31else 32color = this:parse_color(@args); 33if (typeof(color) != STR) 34player:tell("That is not a valid color."); 35player:tell(("Valid colors are " + $su:english_list(colors)) + ". Specify it like 'green' or if you want bold, 'bold green'."); 36player:tell(("For example, 'corp chatcolor " + mode) + " bold green'."); 37else 38if ($ou:has_property(this.channel, prop)) 39this.channel.(prop) = color; 40else 41add_property($biznet, prop, color, {#2, "rc"}); 42endif 43player:tell((((("Color set (" + $ansi.reset) + color) + "example") + $ansi.reset) + ")."); 44endif 45endif 46elseif (mode == "fullcolor") 47this.channel.line_coloring = !this.channel.line_coloring; 48player:tell(tostr("Line coloring is now ", this.channel.line_coloring ? "on" | "off", ".")); 49elseif (mode == "rankcolors") 50this.channel.rank_colors = !this.channel.rank_colors; 51player:tell(tostr("Rank coloring is now ", this.channel.rank_colors ? "on" | "off", ".")); 52elseif (mode == "reset") 53clear_property(this.channel, "color"); 54for x in (keys(this.levels)) 55if ($ou:has_property(this.channel, x + "_color")) 56prop = tostr(x + "_color"); 57clear_property(this.channel, prop); 58endif 59endfor 60clear_property(this.channel, "speech_color"); 61clear_property(this.channel, "verbatim_color"); 62clear_property(this.channel, "rank_colors"); 63clear_property(this.channel, "line_coloring"); 64player:tell("Reset."); 65elseif (mode == "group") 66player:tell(("The groups are: " + $su:english_list(keys(this.levels))) + "."); 67else 68player:tell(tostr($ansi.bold_on, $ansi.yellow, "corp chatcolor identifier [color]", $ansi.reset)); 69player:tell(tostr($ansi.yellow, " Sets the color of the identifier.", $ansi.reset)); 70player:tell(tostr($ansi.bold_on, $ansi.yellow, "corp chatcolor group [color]", $ansi.reset)); 71player:tell(tostr($ansi.yellow, " Sets the color of holders for speech.", $ansi.reset)); 72player:tell(tostr($ansi.bold_on, $ansi.yellow, "corp chatcolor default [color]", $ansi.reset)); 73player:tell(tostr($ansi.yellow, " Sets the default color for speech.", $ansi.reset)); 74player:tell(tostr($ansi.bold_on, $ansi.yellow, "corp chatcolor other [color]", $ansi.reset)); 75player:tell(tostr($ansi.yellow, " Sets the color of other messages (such as contract announcements).", $ansi.reset)); 76player:tell(tostr($ansi.bold_on, $ansi.yellow, "corp chatcolor fullcolor", $ansi.reset)); 77player:tell(tostr($ansi.yellow, " Toggles whether to color just the name or the entire line.", $ansi.reset)); 78player:tell(tostr($ansi.bold_on, $ansi.yellow, "corp chatcolor rankcolors", $ansi.reset)); 79player:tell(tostr($ansi.yellow, " Toggles whether to color names based on their position in the company.", $ansi.reset)); 80player:tell(tostr($ansi.bold_on, $ansi.yellow, "corp chatcolor reset", $ansi.reset)); 81player:tell(tostr($ansi.yellow, " Resets everything back to default.", $ansi.reset)); 82player:tell(("Valid colors are " + $su:english_list(colors)) + ". Specify it like 'green' or if you want bold, 'bold green'."); 83player:tell("For example, 'corp chatcolor identifier bold green'."); 84endif
biz_contracts
Referenced by
none
Source
1"Summarize all your corp's money-making contracts."; 2"Check to see if contract is being dropped"; 3if (args) 4if (args[1] == "drop") 5if (this:perm_check(player, "drop")) 6args = (length(args) > 1) ? args[2..$] | {}; 7drop = $su:from_list(args, " "); 8if (valid(target = $mu:match(drop, this.contents))) 9target:announce(("Dropped by " + player.name) + "."); 10target:expire(); 11return; 12endif 13return player:tell("You don't seem to have a contract by that name."); 14else 15return player:tell("You don't have permissions to drop a contract."); 16endif 17else 18contract = $su:from_list(args, " "); 19if (valid(target = $mu:match(contract, this.contents))) 20player:tell($ansi.bold_on, $ansi.yellow, "Contract info for ", this.company_name, " (", this.symbol, "):", $ansi.reset); 21target:tell_summary(player); 22if (this:perm_check(player, "drop")) 23player:systell(("To drop this contract, type 'corp contract drop " + contract) + "'."); 24endif 25return; 26else 27return player:tell("You don't seem to have a contract by that name."); 28endif 29endif 30return player:tell("Hmmm Wha Huh?"); 31endif 32"Show all contracts held by the business."; 33player:tell($ansi.bold_on, $ansi.yellow, "Contracts for ", this.company_name, " (", this.symbol, "):", $ansi.reset); 34if (!this.contents) 35player:tell($ansi.yellow, "No contracts yet.", $ansi.reset); 36else 37for x in (this.contents) 38x:tell_summary(player); 39endfor 40endif 41if (this:perm_check(player, "drop")) 42player:systell("To drop a contract, type 'corp contract drop <name>'."); 43endif
can_hire
Referenced by
- #167:do_hire line 3:
this:can_hire - #167:biz_hire line 8:
this:can_hire
Source
1who = args[1]; 2return is_a(who, $player) && (!valid(who.employer));
pay_hacker
Referenced by
none
Source
1"is this even called?"; 2#275227:tell((($ansi.red + verb) + " was called by something.") + $ansi.reset); 3#275227:tell(toliteral(callers()));
all_biz_for
Referenced by
none
Source
1who = args[1]; 2b = {}; 3for x in (who.features) 4if (is_a(x, $biz)) 5b = {@b, x}; 6endif 7endfor 8return b;
permit_control
Referenced by
none
Source
1{who, what} = args; 2if (who.employer == this) 3if (is_a(what, $room) && (area(what) in this.controlled_areas)) 4return 1; 5elseif (is_a(what, $lock)) 6return 1; 7elseif ((who in this.ranks["holders"]) && (area(what) in this.controlled_areas)) 8return 1; 9elseif ((is_a(what, $door) && (`what.biz ! E_PROPNF => 0' == this)) && (who in this.ranks["holders"])) 10"wtf, had to add this case for doors not in controlled areas linking to them because someone didn't think of that."; 11return 1; 12endif 13endif
look_self
Referenced by
none
Source
1pass(@args); 2this:tell_employees(player); 3this:tell_money(player);
pay_salaries
Referenced by
- #167:heartbeat line 9:
this:pay_salaries
Source
1for employee in (this.ranks["employees"]) 2if (employee in this.salaries) 3salary = this.salaries[employee]; 4if (salary > 0) 5if (salary > this.credit) 6return; 7endif 8"Let's use :credit_transfer instead, so there'll be a wristpad record of the transaction."; 9this:credit_transfer(employee, salary); 10"Made the messages a little more concise."; 11employee:tell($ansi.bold_on, $ansi.yellow, "[ ", this.symbol, " has paid out ", $ansi.green, "$", salary, $ansi.yellow, " to you in salaries. ]", $ansi.reset); 12for holder in (this.ranks["holders"]) 13holder:tell($ansi.bold_on, $ansi.green, "[ ", this.symbol, " has finished a payroll transaction for ", employee:dnamec(), ": ", $ansi.red, "$", salary, $ansi.green, " ]", $ansi.reset); 14endfor 15endif 16endif 17endfor
heartbeat
Referenced by
none
Source
1"This runs from #6118:on_reset(), at the frequency of that area (gangland) reset interval."; 2this:cam_pay(); 3for x in (this.contents) 4`x:heartbeat() ! ANY => 0'; 5endfor 6if ((time() - this.last_pay) > this.pay_interval) 7$cu:sin(0); 8this.last_pay = time(); 9this:pay_salaries(); 10endif
do_hire
Referenced by
none
Source
1who = args[1]; 2if (!(who in this.ranks["employees"])) 3if (this:can_hire(who)) 4if (who in this.offers) 5this.ranks["employees"] = {@this.ranks["employees"], who}; 6who.employer = this; 7hirer = this.offers[who][2]; 8this.offers = hashremove(this.offers, who); 9who:tell(($ansi.bold_on + $ansi.yellow) + "[ You've been hired by ", this.company_name, "! ]", $ansi.reset); 10who:tell(($ansi.bold_on + $ansi.yellow) + "[ Type 'corp help' to see the employee handbook. ]", $ansi.reset); 11who:add_feature(this.channel); 12this:announce(who:name(), (" was hired by " + hirer:name()) + "."); 13this:log(((who:name() + " was hired by ") + hirer:name()) + "."); 14who:("@subscribe")("*c-" + this.symbol); 15return 1; 16else 17#275227:tell("something went wrong in :do_hire."); 18return 0; 19endif 20endif 21else 22who:tell("You're already in ", this.company_name, "."); 23endif 24if (!valid(this.forum)) 25if (length(this.ranks["employees"]) > 1) 26this:make_forum(); 27endif 28endif
do_fire
Referenced by
- #167:biz_fire line 10:
this:do_fire
Source
1who = args[1]; 2firer = (length(args) > 1) ? args[2] | who; 3holders = this.ranks["holders"]; 4for x in (setremove(keys(this.ranks), "holders")) 5this.ranks[x] = setremove(this.ranks[x], who); 6endfor 7this.salaries = hashremove(this.salaries, who); 8this.employee_privs = hashremove(this.employee_privs, who); 9if (who in holders) 10this.ranks["holders"] = setremove(holders, who); 11if (this.successor && (!this.ranks["holders"])) 12newholders = {}; 13for cand in (this.successor) 14if (cand.employer == this) 15newholders = {@newholders, cand}; 16for level in (keys(this.ranks)) 17this.ranks[level] = setadd(this.ranks[level], cand); 18endfor 19endif 20endfor 21newholders = setremove(newholders, who); 22if (newholders) 23havehas = (length(newholders) > 1) ? " has" | " have"; 24this:announce(($su:capitalize($su:english_list($lu:map_prop(newholders, "name"))) + havehas) + " been promoted to holder by right of named succession."); 25endif 26this.successor = {}; 27endif 28if ((length(this.ranks["holders"]) == 0) && (length(this.ranks["employees"]) > 0)) 29levels = $lu:reverse($lu:slice($lu:sort_alist($hash_utils:to_alist(this.levels), 2))); 30for rank in (levels) 31if (length(this.ranks[rank]) > 0) 32scrub = this.ranks[rank][random($)]; 33for level in (keys(this.ranks)) 34this.ranks[level] = setadd(this.ranks[level], scrub); 35endfor 36this:announce(scrub:dname() + " is now CEO."); 37break; 38endif 39endfor 40endif 41endif 42who.employer = #-1; 43who:remove_feature(this.channel); 44this.offers = hashremove(this.offers, who); 45if (firer == who) 46who:tell(($ansi.bold_on + $ansi.yellow) + "[ You're no longer employed by ", this.company_name, "! ]", $ansi.reset); 47this:announce(who:name(), " left the company."); 48this:log(who:name(), " left the corp."); 49else 50who:tell(($ansi.bold_on + $ansi.yellow) + "[ You were fired from ", this.company_name, (" by " + firer:name()) + "! ]", $ansi.reset); 51this:announce(((who:name() + " was fired by ") + firer:name()) + "!"); 52this:log(who:name(), " was fired by ", firer:name(), "."); 53endif 54if (who in this.successor) 55this.successor = setremove(this.successor, who); 56endif 57who:("@unsubscribe")("*c-" + this.symbol); 58return 1;
biz_summary
Referenced by
none
Source
1"Summarize info about your business."; 2this:summary(player);
summary
Referenced by
- #167:biz_summary line 2:
this:summary
Source
1"Summarize info about your business."; 2who = args[1]; 3salary = (who in this.salaries) ? tostr(this.salaries[who]) | "N/A"; 4who:tell($ansi.yellow, $ansi.bold_on, this.company_name, " (", this.symbol, ")", $ansi.reset); 5this:tell_info(who, "Founded by", $ansi.yellow, (!valid(this.founded_by)) ? "Before founders were recorded." | this.founded_by:dnamec(), $ansi.reset); 6this:tell_info(who, "Founded at", $ansi.yellow, (this.founded_at == 0) ? "Before founding times were recorded." | $time:ctime($time:time(this.founded_at)), $ansi.reset); 7if (this.motd) 8this:tell_info(who, "MOTD", $ansi.cyan, $su:escape(this.motd), $ansi.reset); 9endif 10this:tell_info(who, "Credit", $ansi.green, $ansi.bold_on, "$", $su:group_number(this.credit), $ansi.reset); 11rating_grade = this:rating_grade(); 12if (rating_grade) 13this:tell_info(who, "Audit grade", $ansi.purple, $ansi.bold_on, rating_grade[1], $ansi.bold_off, " -- ", $ansi.bold_on, rating_grade[2], $ansi.reset); 14endif 15"employees list portion"; 16displayed = {}; 17for x in ($lu:reverse($lu:slice($lu:sort_alist($hash_utils:to_alist(this.levels), 2), 1))) 18display = this.ranks[x]; 19display = $set_utils:difference(display, displayed); 20displayed = {@displayed, @display}; 21if (!display) 22display = "None"; 23long = ""; 24else 25long = (tostr(length(display)) + $ansi.bold_off) + " -- "; 26display = $su:english_list($lu:sort_suspended(1, $lu:map_prop(display, "name"))); 27endif 28this:tell_info(who, $su:capitalize(x), $ansi.yellow, $ansi.bold_on, long, display, $ansi.reset); 29endfor 30successor = (length(this.successor) > 0) ? $su:english_list($lu:map_prop(this.successor, "name")) | "None"; 31succname = (length(this.successor) > 1) ? "Successors" | "Successor"; 32this:tell_info(who, succname, $ansi.yellow, successor, $ansi.reset); 33"employees list portion end"; 34this:tell_info(who, "Pay Rate", $ansi.yellow, this.pay_rate, $ansi.reset); 35this:tell_info(who, "Shop Pay Rate", $ansi.yellow, this.shop_pay_rate, $ansi.reset); 36this:tell_info(who, "Next Payout", $ansi.yellow, $time_utils:english_time(this.pay_interval - (time() - this.last_pay)), $ansi.reset); 37this:tell_info(who, "Salary", $ansi.green, $ansi.bold_on, "$", salary, $ansi.reset); 38this:tell_info(who, "Contracts", $ansi.yellow, "[", length(this.contents), "] " + $su:english_list($lu:map_prop(this.contents, "name")), $ansi.reset); 39this:tell_info(who, "Cameras", $ansi.yellow, length(this.cams), " out of ", length(children(#8659)), $ansi.reset); 40this:tell_info(who, "Camera channel", $ansi.yellow, this.cam_channel, $ansi.reset); 41shops = {}; 42for shop in (this.shops) 43shopstr = shop.location.name; 44if (valid(shop.clerk)) 45shopstr = tostr(((shopstr + " ($") + tostr(shop.clerk.credit)) + ")"); 46endif 47shops = setadd(shops, shopstr); 48endfor 49this:tell_info(who, "Retail Stores", $ansi.green, $ansi.bold_on, $su:english_list(shops), $ansi.reset); 50areas = {}; 51for a in (this.controlled_areas) 52areas = setadd(areas, a.name); 53endfor 54this:tell_info(who, "Controlled Areas", $ansi.green, $ansi.bold_on, $su:english_list(areas), $ansi.reset); 55who:tell("For other corp commands, type 'corp help'.");
biz_hire
Referenced by
none
Source
1"hire <person> - Offer to hire a new employee."; 2if (args) 3who = $match_utils:match($su:from_list(args, " "), player.location:occupants($player)); 4if (!valid(who)) 5player:tell("Hire who?"); 6elseif (valid(who.employer)) 7player:tell("You can't hire ", who:iname(), "; ", who.ps, " is already employed."); 8elseif (!this:can_hire(who)) 9player:tell("You can't hire ", who:iname(), "."); 10elseif ((who in this.offers) && ((this.offers[who][1] + 86400) > time())) 11player:tell("You've already extended an offer to ", who:dname(), ". They can accept by typing 'join ", this.symbol, "' and the offer will expire after one real day from when it was originally made."); 12else 13this:extend_offer(who); 14player:tell(($ansi.bold_on + $ansi.yellow) + "You extended an offer to ", who:iname(), " to join ", this.company_name, " (", this.symbol, ")."); 15player:tell(who.psc, " can accept by typing 'join ", this.symbol, "'. The job offer will expire in 24 hours.", $ansi.reset); 16endif 17else 18this:tell_employees(player); 19endif
biz_employees
Referenced by
none
Source
1"List data on the company's employees."; 2bl = {}; 3for who in (keys(this.salaries)) 4whoname = who:name(); 5total = this.salaries[who]; 6bl = {@bl, {whoname, total}}; 7endfor 8bl = $lu:reverse($lu:sort_alist(bl, 2)); 9player:tell($ansi.bold_on, $ansi.yellow, "Employees of ", this.company_name, " (", this.symbol, "):"); 10player:tell($ansi.bg_blue, $ansi.white, $ansi.bold_on, $ansi.underline_on, "Employee Salary ", $ansi.reset); 11for x in (bl) 12player:tell($ansi.yellow, $su:left(x[1], -20), $ansi.green, "$", $su:left($su:group_number(x[2]), -15), $ansi.reset); 13endfor 14if (!bl) 15player:tell("None of your employees have a salary."); 16endif
disband_cleanup
Referenced by
- #167:biz_disband line 44:
this:disband_cleanup
Source
1for x in (this.ranks["employees"]) 2`x.employer = #-1 ! ANY'; 3endfor 4for x in (this.contents) 5x:expire(); 6$cu:sin(); 7endfor 8is_a(this.channel, $biznet) && $recycler:_recycle(this.channel); 9is_a(this.forum, #45) && $recycler:_recycle(this.forum); 10(this in #304727.subscribed_corps) && (#304727.subscribed_corps = setremove(#304727.subscribed_corps, this)); 11for lobby in ($ou:leaves(#88701)) 12if (valid(door = lobby:door_for(this))) 13fork (0) 14lobby:_do_evict(door); 15endfork 16endif 17yield; 18endfor 19for case in (this.shops) 20if (is_a(case, #207540) && (area(case) == #264766)) 21storeent = `case.location:occupants(#3385)[1].otherside ! ANY => #-1'; 22if (valid(storeent)) 23fork (0) 24#247238:_do_evict(storeent); 25endfork 26endif 27endif 28endfor
perm_check
Referenced by
- #167:biz_contracts line 5:
this:perm_check - #167:biz_contracts line 22:
this:perm_check - #167:biz_contracts line 41:
this:perm_check - #167:biz_help line 4:
this:perm_check - #167:biz_withdraw line 12:
this:perm_check
Source
1{who, command} = args; 2if (who in this.ranks["holders"]) 3return 1; 4endif 5checklist = {}; 6for rank in (keys(this.ranks)) 7if (who in this.ranks[rank]) 8checklist = {@checklist, rank}; 9endif 10endfor 11for check in (checklist) 12if (command in this.rank_privs[check]) 13return 1; 14endif 15endfor 16if ((who in this.employee_privs) && (command in this.employee_privs[who])) 17return 1; 18endif 19return 0;
biz_help
Referenced by
none
Source
1"List all biz commands."; 2c = {}; 3for x in (this.biz_commands) 4if (this:perm_check(player, x)) 5c = {@c, x}; 6endif 7endfor 8commands = {@c, @this.nonperm_commands}; 9for x in (commands) 10v = "biz_" + x; 11player:tell($ansi.yellow, $ansi.bold_on, "corp ", x, $ansi.reset); 12lines = $code_utils:verb_documentation($biz, v); 13for x in (lines) 14player:tell(" ", $ansi.yellow, x, $ansi.reset); 15endfor 16endfor
biz_withdraw
Referenced by
none
Source
1"Withdraw credit from the business to your personal account."; 2if (!args) 3player:tell("Withdraw how much?"); 4return; 5endif 6amount = toint(args[1]); 7if (amount < 0) 8player:tell("Nice try. You can only withdraw positive amounts of money."); 9return; 10endif 11if (amount) 12if ((amount <= this.credit) && this:perm_check(player, "withdraw")) 13this:credit_transfer(player, amount); 14this:log(((("$" + tostr(amount)) + " withdrawn by ") + player.name) + "."); 15elseif (amount > this.credit) 16player:tell(this:dnamec(), " only has $", this.credit, "."); 17else 18player:tell("You don't have permissions to withdraw money."); 19endif 20else 21player:tell("Usage: biz withdraw <amount>"); 22endif
level
Referenced by
- #167:biz_fire line 6:
this:level - #167:biz_fire line 6:
this:level - #167:biz_promote line 7:
this:level - #167:biz_promote line 8:
this:level - #167:biz_demote line 7:
this:level - #167:biz_demote line 8:
this:level - #167:biz_demote line 24:
this:level - #167:biz_voteout line 29:
this:level
Source
1who = args[1]; 2levels = {}; 3for rank in (keys(this.ranks)) 4if (who in this.ranks[rank]) 5levels = {@levels, this.levels[rank]}; 6endif 7endfor 8level = (length(levels) > 0) ? max(@levels) | 1; 9return level;
biz_fire
Referenced by
none
Source
1"fire <employee> - Fire an employee."; 2if (args) 3who = $match_utils:match($su:from_list(args, " "), this.ranks["employees"]); 4if (!valid(who)) 5player:tell(this.company_name, " has no employee named '", @args, "'."); 6elseif ((this:level(player) <= this:level(who)) && (player != who)) 7player:tell("You can't fire someone with the same rank or a higher rank than you."); 8return; 9else 10this:do_fire(who, player); 11player:tell("You've fired ", who:dname(), " from ", this.company_name, "."); 12endif 13else 14player:tell("Usage: corp fire <employee>"); 15endif
biz_resign
Referenced by
none
Source
1"Resign from your current employer."; 2biz = player.employer; 3player:tell("You're currently employed by ", biz.company_name, "."); 4player:tell("Are you sure you want to resign?"); 5if ($cu:yes_or_no()) 6if (length(biz.ranks["employees"]) == 1) 7return player:tell("Well... I dunno what to tell you kid. Looks like you're alone here. Please disband the corporation."); 8endif 9player:tell("You've resigned from ", biz.company_name, ". You can now be employed by another business."); 10biz:do_fire(player); 11else 12player:tell("Cancelled."); 13endif
biz_promote
Referenced by
none
Source
1"promote <person> - person will get a higher rank in the corp."; 2if (args) 3who = $match_utils:match($su:from_list(args, " "), this.ranks["employees"]); 4if (!valid(who)) 5player:tell("Promote who?"); 6else 7playerlevel = this:level(player); 8whooldlevel = this:level(who); 9if ((playerlevel <= whooldlevel) && (!player.programmer)) 10player:tell("You can't promote that person any further."); 11else 12levels = $lu:sort_alist($hash_utils:to_alist(this.levels), 2); 13newlevel = whooldlevel in $lu:slice(levels, 2); 14newlevel = newlevel + 1; 15newjob = levels[newlevel][1]; 16if (!$cu:yes_or_no(((("Are you SURE you want to promote " + who:name()) + " to ") + newjob) + "?")) 17player:tell("Aborted."); 18return; 19endif 20this.ranks[newjob] = {@this.ranks[newjob], who}; 21this:announce(((((who:dname() + " has been promoted to ") + newjob) + " by ") + player:name()) + "."); 22this:log(((((player:dname() + " promoted ") + who:name()) + " to ") + newjob) + "."); 23endif 24endif 25else 26this:tell_employees(player); 27endif
biz_demote
Referenced by
none
Source
1"demote <person> - Kick 'em back to the salt mines."; 2if (args) 3who = $match_utils:match($su:from_list(args, " "), this.ranks["employees"]); 4if (!valid(who)) 5player:tell("Demote who?"); 6else 7playerlevel = this:level(player); 8whooldlevel = this:level(who); 9if (((playerlevel <= whooldlevel) && (player != who)) && (!player.programmer)) 10player:tell("You can't demote that person, you don't have enough power."); 11elseif (whooldlevel == 1) 12player:tell("The dude is already working in the salt mines. You can't demote him any further!"); 13elseif (((player in this.ranks["holders"]) && (player == who)) && (length(this.ranks["holders"]) == 1)) 14player:tell("You can't demote yourself! Who would run the company?"); 15else 16levels = $lu:sort_alist($hash_utils:to_alist(this.levels), 2); 17oldlevel = whooldlevel in $lu:slice(levels, 2); 18newlevel = oldlevel - 1; 19oldjob = levels[oldlevel][1]; 20newjob = levels[newlevel][1]; 21if (!$cu:yes_or_no(((("Are you SURE you want to demote " + who:name()) + " to ") + newjob) + "?")) 22player:tell("Aborted."); 23return; 24elseif (((playerlevel != this:level(player)) || (!(player in this.ranks["employees"]))) && (!player.programmer)) 25player:tell("Something has changed in the corporate hierarchy and you are no longer able to perform this function. Bring it up with your superiors."); 26return; 27endif 28this.ranks[oldjob] = setremove(this.ranks[oldjob], who); 29this:announce(((((who:dname() + " has been demoted to ") + newjob) + " by ") + player:name()) + "."); 30this:log(((((player:dname() + " demoted ") + who:name()) + " to ") + newjob) + "."); 31endif 32endif 33else 34this:tell_employees(player); 35endif
biz_access
Referenced by
none
Source
1"corp access add/remove group/person command, to add/remove privileges from ranks or specific people."; 2commands = {@this.biz_commands, @this.other_perms}; 3if (length(args) < 3) 4player:tell("The command syntax is 'corp access add/remove group/person command'."); 5player:tell(("The possible commands are: " + $su:english_list(commands)) + "."); 6return; 7endif 8who = $match_utils:match(args[2], this.ranks["employees"]); 9cmd = $su:match_stringlist(args[3], commands); 10if (!valid(who)) 11who = $su:match_stringlist(args[2], keys(this.levels)); 12endif 13if ((((typeof(who) == OBJ) && valid(who)) && (args[1] in {"add", "remove"})) && (typeof(cmd) == INT)) 14this:employee_access(args[1], who, cmd); 15elseif (((typeof(who) == INT) && (args[1] in {"add", "remove"})) && (typeof(cmd) == INT)) 16this:group_access(args[1], who, cmd); 17else 18player:tell("The command syntax is 'corp access add/remove group/person command'."); 19player:tell(("The possible commands are: " + $su:english_list(commands)) + "."); 20endif
group_access
Referenced by
- #167:biz_access line 16:
this:group_access
Source
1{addremove, group, cmd} = args; 2group = keys(this.levels)[group]; 3commands = {@this.biz_commands, @this.other_perms}; 4cmd = commands[cmd]; 5if (!(group in this.rank_privs)) 6this.rank_privs[group] = {}; 7endif 8if (addremove == "add") 9if (cmd in this.rank_privs[group]) 10player:tell($su:capitalize(group) + " already can use that."); 11return; 12endif 13this.rank_privs[group] = {@this.rank_privs[group], cmd}; 14player:tell(((("Allowed " + group) + " to use corp ") + cmd) + "."); 15this:log(((((player:dnamec() + " allowed ") + group) + " to use corp ") + cmd) + "."); 16else 17if (cmd in this.rank_privs[group]) 18newprivs = setremove(this.rank_privs[group], cmd); 19this.rank_privs[group] = newprivs; 20player:tell(((("Disabled " + group) + " from using corp ") + cmd) + "."); 21this:log(((((player:dnamec() + " disabled ") + group) + " from using corp ") + cmd) + "."); 22else 23player:tell($su:capitalize(group) + " didn't have that privilege anyway."); 24endif 25endif
employee_access
Referenced by
- #167:biz_access line 14:
this:employee_access
Source
1{addremove, who, cmd} = args; 2commands = {@this.biz_commands, @this.other_perms}; 3cmd = commands[cmd]; 4if (addremove == "add") 5if ((who in this.employee_privs) && (cmd in this.employee_privs[who])) 6player:tell(who:dnamec() + " already can use that."); 7return; 8endif 9if (who in this.employee_privs) 10this.employee_privs[who] = {@this.employee_privs[who], cmd}; 11else 12this.employee_privs[who] = {cmd}; 13endif 14player:tell(((("Allowed " + who:name()) + " to use corp ") + cmd) + "."); 15this:log(((((player:dnamec() + " allowed ") + who:name()) + " to use corp ") + cmd) + "."); 16else 17if ((who in this.employee_privs) && (cmd in this.employee_privs[who])) 18newprivs = setremove(this.employee_privs[who], cmd); 19if (newprivs) 20this.employee_privs[who] = newprivs; 21else 22this.employee_privs = hashremove(this.employee_privs, who); 23endif 24player:tell(((("Disabled " + who:name()) + " from using corp ") + cmd) + "."); 25this:log(((((player:dnamec() + " disabled ") + who:name()) + " from using corp ") + cmd) + "."); 26else 27player:tell(who:dnamec() + " didn't have that privilege anyway."); 28endif 29endif
biz_salary
Referenced by
none
Source
1"corp salary person <amount> - this is how much the person will be paid every game week."; 2if (length(args) < 2) 3player:tell("The syntax is 'corp salary person amount'."); 4return; 5endif 6who = $match_utils:match(args[1], this.ranks["employees"]); 7amount = toint(args[2]); 8if (!valid(who)) 9player:tell("The syntax is 'corp salary person amount'."); 10return; 11elseif (((typeof(amount) != INT) || (amount < 0)) || (amount > 20000)) 12player:tell("Get real, dumbass. Pick a number between 0 and 20000."); 13return; 14endif 15if (amount == 0) 16if (who in this.salaries) 17this.salaries = hashremove(this.salaries, who); 18player:tell(("You removed " + who:name()) + "'s salary."); 19this:log(((player:dnamec() + " removed ") + who:name()) + "'s salary."); 20else 21player:tell(who:dnamec() + " didn't have a salary anyway."); 22endif 23else 24this.salaries[who] = amount; 25player:tell(((("You changed " + who:name()) + "'s salary to ") + tostr(amount)) + "."); 26this:log(((((player:dnamec() + " changed ") + who:name()) + "'s salary to ") + tostr(amount)) + "."); 27endif
biz_listperms
Referenced by
none
Source
1"corp listperms - list perms for groups and people."; 2player:tell("Reminder: all permissions have upwards inheritance."); 3player:tell(($ansi.bold_on + "Groups") + $ansi.reset); 4groups = setremove($lu:slice($lu:sort_alist($hash_utils:to_alist(this.levels), 2), 1), "holders"); 5lines = {}; 6fullprivs = {}; 7for rank in (groups) 8privs = this.rank_privs[rank]; 9fullprivs = $lu:remove_duplicates({@fullprivs, @privs}); 10showprivs = (length(fullprivs) < 0) ? "None" | $su:capitalize($su:english_list(fullprivs)); 11line = ($su:left($su:capitalize(rank), -12) + " ") + showprivs; 12lines = {line, @lines}; 13endfor 14player:tell_lines(lines); 15player:tell_lines({"", ($ansi.bold_on + "Employees") + $ansi.reset}); 16if (!keys(this.employee_privs)) 17player:tell("No employee perms."); 18endif 19for who in (keys(this.employee_privs)) 20line = ($su:left(who:name(), -12) + " ") + $su:capitalize($su:english_list(this.employee_privs[who])); 21player:tell(line); 22endfor 23player:tell("Done.");
biz_sign
Referenced by
none
Source
No program (verb defined but unprogrammed).
biz_successor
Referenced by
none
Source
1"Successors may be named for the eventuality where the single remaining CEO resigns."; 2if ((length(args) < 2) || (length(args) > 2)) 3player:tell("The proper format is 'corp successor add/remove person'."); 4return; 5endif 6who = $match_utils:match(args[2], this.ranks["employees"]); 7if ((valid(who) && is_player(who)) && (who.employer == this)) 8if (args[1] == "add") 9if (!(who in this.successor)) 10this:announce(((player:dnamec() + " made ") + who:name()) + " a successor."); 11player:tell(("You made " + who:name()) + " a successor."); 12this:log(((player:dnamec() + " made ") + who:name()) + " a successor."); 13this.successor = {@this.successor, who}; 14else 15player:tell(who:dnamec() + " is already a successor."); 16endif 17elseif (args[1] == "remove") 18if (who in this.successor) 19this:announce(((player:dname() + " removed ") + who:name()) + " from the list of successors."); 20player:tell(("You removed " + who:name()) + " from the list of successors."); 21this:log(((player:dname() + " removed ") + who:name()) + " from the list of successors."); 22this.successor = setremove(this.successor, who); 23else 24player:tell(who:dnamec() + " isn't a successor anyway."); 25endif 26else 27player:tell("The proper format is 'corp successor add/remove person'."); 28endif 29else 30player:tell("The proper format is 'corp successor add/remove person'."); 31player:tell("The successor has to be in your corp."); 32endif
is_a_holder
Referenced by
none
Source
1who = args[1]; 2biz = who.employer; 3return valid(biz) && (who in biz.ranks["holders"]);
biz_takeover
Referenced by
none
Source
1"As management, take over the company from a missing-in-action CEO."; 2biz = player.employer; 3if (player in biz.ranks["holders"]) 4player:tell("You're already a CEO!"); 5elseif (max(@$lu:map_arg($bf, "is_connected", this.ranks["holders"]))) 6player:tell("Gee. Didn't you notice that there's a holder online RIGHT NOW?"); 7else 8for rank in (levels = $lu:reverse($lu:slice($lu:sort_alist($hash_utils:to_alist(this.levels), 2)))) 9if (player in this.ranks[rank]) 10who_index = rank in levels; 11break; 12endif 13endfor 14for rank in (levels) 15scrub_index = rank in levels; 16if (scrub_index < who_index) 17for scrub in (this.ranks[rank]) 18if (is_connected(scrub) || ((time() - scrub.last_connect_time) < this.takeover_wait)) 19player:tell("You can't takeover because someone of a higher rank than you is still active."); 20return; 21endif 22endfor 23endif 24endfor 25for newlevel in (setremove(keys(this.ranks), "holders")) 26this.ranks[newlevel] = setadd(this.ranks[newlevel], player); 27endfor 28this.ranks["holders"] = {player}; 29this:announce(m = ("All the holders of this corporation have been deemed unfit, and demoted. " + player:dnamec()) + " is now CEO."); 30this:log(m); 31endif
biz_shoplog
Referenced by
none
Source
1"Middle managers can check the log of interactions with corporate-controlled stores."; 2if (valid(biz = player.employer)) 3if (log = biz.shop_logs) 4for shop in (log) 5player:tell($ansi.yellow, $ansi.bold_on, shop[1]:room():name(), ":", $ansi.reset); 6if (record = shop[2]) 7for entry in (record) 8player:tell($ansi.yellow, " ", $time:ctime(entry[1]), ": ", $ansi.cyan, entry[2], $ansi.reset); 9endfor 10else 11player:tell($ansi.yellow, " [ No entries. ]", $ansi.reset); 12endif 13yield; 14endfor 15else 16player:tell("Either you don't have a store or you are advertising poorly. Your corp has no shop log."); 17endif 18endif
biz_inactives
Referenced by
none
Source
1"Show the list of inactive employees for the whole corp."; 2displayed = {}; 3connected = connected_players(); 4player:tell(($ansi.yellow + $ansi.bold_on) + "Inactive Employees:"); 5for rank in ($lu:reverse($lu:slice($lu:sort_alist($hash_utils:to_alist(this.levels), 2), 1))) 6display = this.ranks[rank]; 7reallist = {}; 8for inactive in (display) 9if (((time() - inactive.last_connect_time) >= this.takeover_wait) && (!(inactive in connected))) 10reallist = setadd(reallist, inactive); 11endif 12endfor 13reallist = $set_utils:difference(reallist, displayed); 14displayed = {@displayed, @display}; 15if (!reallist) 16reallist = "None"; 17long = ""; 18else 19long = (tostr(length(reallist)) + $ansi.bold_off) + " -- "; 20reallist = $su:english_list($lu:sort_suspended(1, $lu:map_prop(reallist, "name"))); 21endif 22this:tell_info(player, $su:capitalize(rank), $ansi.yellow, $ansi.bold_on, long, reallist, $ansi.reset); 23endfor
is_holder
Referenced by
none
Source
1return args[1] in this.ranks["holders"];
biz_voteout
Referenced by
none
Source
1"voteout <person> - Vote one of your fellow holders out of the job."; 2holders = this.ranks["holders"]; 3if (!(player in holders)) 4player:tell("You can't do that, you're just a scrub."); 5return; 6elseif (length(holders) == 1) 7player:tell("You're the only one, and you can't vote yourself out."); 8return; 9elseif (length(holders) == 2) 10player:tell("You can't make a majority out of just yourself."); 11return; 12endif 13if (valid(this.unwanted_holder)) 14"vote in progress"; 15who = this.unwanted_holder; 16if (player in this.unwanted_votes) 17player:tell("You've already voted."); 18return; 19endif 20if (!$cu:yes_or_no(("Are you SURE you want to vote to remove " + who:name()) + " from management?")) 21player:tell("Aborted."); 22return; 23endif 24this:announce(((player:dname() + " has voted to remove ") + who:name()) + " from corp management."); 25this.unwanted_votes = {@this.unwanted_votes, player}; 26needed = ((length(holders) / 2) + 1) - length(this.unwanted_votes); 27if (needed == 0) 28this:announce("The removal vote has passed."); 29whooldlevel = this:level(who); 30levels = $lu:sort_alist($hash_utils:to_alist(this.levels), 2); 31oldlevel = whooldlevel in $lu:slice(levels, 2); 32newlevel = oldlevel - 1; 33oldjob = levels[oldlevel][1]; 34newjob = levels[newlevel][1]; 35this.ranks[oldjob] = setremove(this.ranks[oldjob], who); 36this:announce(((who:dname() + " has been demoted to ") + newjob) + " by majority vote of holders."); 37this:log(((who:dname() + " has been demoted to ") + newjob) + " by a majority vote of holders."); 38task_valid(this.unwanted_vote_task) && kill_task(this.unwanted_vote_task); 39this.unwanted_vote_task = 0; 40this.unwanted_holder = #-1; 41this.unwanted_votes = {}; 42else 43this:announce(tostr(needed, " more votes are required for the vote to pass.")); 44endif 45return; 46endif 47if (args) 48who = $match_utils:match($su:from_list(args, " "), holders); 49if (!valid(who)) 50player:tell("Vote who out?"); 51return; 52else 53if (!$cu:yes_or_no(("Are you SURE you want to initiate a vote to remove " + who:name()) + " from management? (They will be demoted to the second highest rank.)")) 54player:tell("Aborted."); 55return; 56endif 57this:announce(((player:dname() + " initiated a vote to remove ") + who:name()) + " from management."); 58this:log(((player:dname() + " initiated a vote to remove ") + who:name()) + " from management."); 59needed = length(holders) / 2; 60this.unwanted_votes = {player}; 61this:announce(tostr(needed), " votes are required for the vote to pass."); 62fork taskid (300) 63this:announce(("Voting is now closed. " + this.unwanted_holder:dname()) + " will remain in corp management."); 64this:log(this.unwanted_holder:dname() + " will remain in corp management. The removal vote did not pass."); 65this.unwanted_holder = #-1; 66this.unwanted_vote_task = 0; 67this.unwanted_votes = {}; 68endfork 69this.unwanted_vote_task = taskid; 70this.unwanted_holder = who; 71return; 72endif 73else 74player:tell("Vote who out?"); 75endif
do_disband
Referenced by
none
Source
No program (verb defined but unprogrammed).
old_cleanup
Referenced by
none
Source
1"Copied from Alastor's New $biz object (#128822):disband_cleanup by Shana (#350044) Mon Feb 22 17:54:23 2010 CST"; 2for x in (this.ranks["employees"]) 3x.employer = #-1; 4endfor 5for x in (this.contents) 6x:expire(); 7$cu:sin(); 8endfor 9is_a(this.channel, $biznet) && $recycler:_recycle(this.channel); 10is_a(this.forum, #45) && $recycler:_recycle(this.forum); 11(this in #304727.subscribed_corps) && (#304727.subscribed_corps = setremove(#304727.subscribed_corps, this)); 12for case in (this.shops) 13if (is_a(case, #207540) && (case:area() == #264766)) 14storeent = case.location:occupants(#3385)[1].otherside; 15fork (0) 16#247238:_do_evict(storeent); 17endfork 18endif 19endfor
_old_takeover
Referenced by
none
Source
1"As management, take over the company from a missing-in-action CEO."; 2biz = player.employer; 3if (player in biz.ranks["holders"]) 4player:tell("You're already a CEO!"); 5else 6holders = biz.ranks["holders"]; 7for ceo in (holders) 8if (ceo in connected_players()) 9player:tell("What the hell? A CEO is on RIGHT NOW."); 10return; 11elseif (is_player(ceo) && ((time() - ceo.last_connect_time) < biz.takeover_wait)) 12player:tell(("You can't take over the corp unless all the holders have been inactive for " + $time:duration(biz.takeover_wait)) + " of realtime."); 13return; 14endif 15endfor 16for rank in ($lu:reverse($lu:slice($lu:sort_alist($hash_utils:to_alist(this.levels), 2)))) 17for scrub in (this.ranks[rank]) 18if (((time() - scrub.last_connect_time) < biz.takeover_wait) || (scrub in connected_players())) 19cands = this.ranks[rank]; 20break; 21endif 22endfor 23endfor 24if (player in cands) 25for newlevel in (setremove(keys(this.ranks), "holders")) 26this.ranks[newlevel] = setadd(this.ranks[newlevel], player); 27endfor 28this.ranks["holders"] = {player}; 29this:announce(("All the holders of this corporation have been deemed unfit, and demoted. " + player:dnamec()) + " is now CEO."); 30this:log(("All the holders of this corporation have been deemed unfit, and demoted. " + player:dnamec()) + " is now CEO."); 31else 32player:tell("Someone of higher rank than you is active. Sorry, bud."); 33endif 34endif
rating
Referenced by
- #167:tree_tag line 6:
this:rating - #167:rating_grade line 1:
this:rating
Source
1return min(this:raw_rating(), 100);
raw_rating
Referenced by
- #167:rating line 1:
this:raw_rating
Source
1if (this.rating_override) 2return this.rating_override; 3endif 4rating = 0; 5"Up to 20 active players count toward a possible 5% of rating value."; 6rating = rating + (min(this:active_players(), 20) / 4); 7"Up to 100 completed contracts count toward a possible 25% of rating value."; 8rating = rating + (min(length(this.completed_contracts), 100) / 4); 9"Up to $5 million counts toward 10% of rating value."; 10rating = rating + (min(this.credit, 5000000) / 500000); 11"Up to 2 points for existing sim contracts."; 12rating = rating + min(length(occupants(this, $sim_contract)), 2); 13"To-do: more business rating influence."; 14return rating;
rating_grade
Referenced by
- #167:tree_tag line 7:
this:rating_grade - #167:summary line 11:
this:rating_grade
Source
1rating = this:rating(); 2count = length(this.rating_grades); 3pct = tofloat(rating) / 100.0; 4index = max(1, toint($math_utils:rint(pct * tofloat(count)))); 5return this.rating_grades[index];
title_for
Referenced by
none
Source
1":title_for(OBJ employee) => STR title. right now just gives the singular name of their highest rank, in the future, maybe should be something that can be changed by holders or whatever."; 2"raises E_INVARG if employee is not a player or not employed by this."; 3{who} = args; 4if ((!is_a(who, $player)) || (who.employer != this)) 5raise(E_INVARG); 6endif 7max_level = 0; 8max_rank = ""; 9for rank in (keys(this.ranks)) 10level = this.levels[rank]; 11if ((level > max_level) && (who in this.ranks[rank])) 12max_level = level; 13max_rank = rank; 14endif 15endfor 16if (max_rank == "") 17return "Nobody"; 18else 19return this.levels_singular[max_rank]; 20endif
biz_shoprate
Referenced by
none
Source
1"Copied from generic corp (#128822):biz_rate by Pan (#413632) Tue Aug 31 16:16:55 2010 CDT"; 2"Check or set the rate on commissions paid to employees."; 3if (args) 4try 5rate = tofloat(tostr(args[1])); 6rate = tofloat(toint(rate * 100.0)) / 100.0; 7except (E_INVARG) 8player:tell("Try a real number, dickhead."); 9return; 10endtry 11if ((rate < 0.0) || (rate > 1.0)) 12player:tell("The shop pay rate must be between 0.0 (no pay) and 1.0 (full commission, no profit to the business)."); 13else 14this.shop_pay_rate = rate; 15this:announce("The shop pay rate has been changed to ", tostr(rate), " by ", player:name(), "."); 16this:log(((("Pay rate changed to " + tostr(rate)) + " by ") + player:name()) + "."); 17endif 18endif 19player:tell($ansi.yellow, $ansi.bold_on, "Current shop pay rate for ", this.company_name, " (", this.symbol, ") is ", $ansi.green, this.shop_pay_rate, $ansi.yellow, ".", $ansi.reset);
credit_balance
Referenced by
none
Source
1return this.credit;
credit_charge
Referenced by
none
Source
1"Copied from generic RPG player (#132):credit_charge by Jed (#45097) Wed Oct 6 16:06:59 2010 CDT"; 2":credit_charge(INT amount)"; 3"Charge the player's credit 'amount' dollars. Return 0 if they don't have it."; 4amt = args[1]; 5if (amt > this.credit) 6return 0; 7else 8this:credit_transfer(#-1, amt); 9return 1; 10endif
biz_camchannel
Referenced by
none
Source
1if (args) 2try 3chan = toint(args[1]); 4except (E_INVARG) 5player:tell("Try a real number, dickhead."); 6return; 7endtry 8if (chan < 1) 9player:tell("Choose a number greater than 0."); 10else 11this.cam_channel = chan; 12this:announce("The camera channel has been changed to ", tostr(chan), " by ", player:name(), "."); 13this:log(((("Camera channel changed to " + tostr(chan)) + " by ") + player:name()) + "."); 14endif 15endif 16player:tell($ansi.yellow, $ansi.bold_on, "Current camera channel for ", this.company_name, " (", this.symbol, ") is ", this.cam_channel, ".", $ansi.reset);
level_for
Referenced by
none
Source
1"Copied from generic corp (#128822):title_for by Seraph (#7195) Thu Jan 20 20:42:01 2011 CST"; 2":title_for(OBJ employee) => STR title. right now just gives the singular name of their highest rank, in the future, maybe should be something that can be changed by holders or whatever."; 3"raises E_INVARG if employee is not a player or not employed by this."; 4{who} = args; 5if (!is_a(who, $player)) 6raise(E_INVARG); 7endif 8max_level = 0; 9max_rank = ""; 10for rank in (keys(this.ranks)) 11level = this.levels[rank]; 12if ((level > max_level) && (who in this.ranks[rank])) 13max_level = level; 14max_rank = rank; 15endif 16endfor 17return max_level;
is_dead
Referenced by
none
Source
1"return 1 if this corp has expired on the public scene and should start losing shit"; 2for dude in (this.ranks["employees"]) 3if (is_player(dude)) 4if (is_connected(dude) || ((time() - dude.last_disconnect_time) < (86400 * 60))) 5return 0; 6endif 7endif 8endfor 9return 1;
systell
Referenced by
none
Source
1this:announce(@args);