player = self.get_player(c_id)
self.io.send('PLAYERS_HAT_CHARS ' + quote(player.get_cookie_chars()),
c_id)
- self.io.send('BLADDER_PRESSURE %s' % player.need_for_toilet, c_id)
+ self.io.send('STATS %s %s' % (player.need_for_toilet,
+ player.weariness), c_id)
if player.id_ in player_ids_send_fov:
self.io.send('FOV %s' % quote(player.fov_stencil.terrain), c_id)
self.io.send('MAP %s %s %s' % (self.get_map_geometry_shape(),
class ThingAnimate(Thing):
+ weariness = 0
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
task = self.next_task[0]
self.next_task = [None]
task.check()
+ task.todo += self.weariness * 10
return task
def proceed(self):
elif self.tripping > 0 and self.tripping % 250 == 0:
self.send_msg('RANDOM_COLORS')
self.game.changed = True
+ if random.random() > 0.9999:
+ if self.standing:
+ self.weariness += 1
+ elif self.weariness > 0:
+ self.weariness -= 1
def send_msg(self, msg):
for c_id in self.game.sessions:
</div>
<script>
"use strict";
-//let websocket_location = "wss://plomlompom.com/rogue_chat/";
-let websocket_location = "ws://localhost:8000/";
+let websocket_location = "wss://plomlompom.com/rogue_chat/";
+//let websocket_location = "ws://localhost:8000/";
let mode_helps = {
'play': {
game.portals_new = {};
explorer.annotations_new = {};
game.things_new = [];
- } else if (tokens[0] === 'BLADDER_PRESSURE') {
+ } else if (tokens[0] === 'STATS') {
game.bladder_pressure_new = parseInt(tokens[1])
+ game.weariness_new = parseInt(tokens[2])
} else if (tokens[0] === 'THING') {
let t = game.get_thing_temp(tokens[4], true);
t.position = parser.parse_yx(tokens[1]);
game.player = game.things[game.player_id];
game.players_hat_chars = game.players_hat_chars_new;
game.bladder_pressure = game.bladder_pressure_new
+ game.weariness = game.weariness_new
game.turn_complete = true;
if (tui.mode.name == 'post_login_wait') {
tui.switch_mode('play');
terminal.write(0, this.window_width, 'MODE: ' + this.mode.short_desc + ' – ' + help);
},
draw_stats_line: function(n) {
- terminal.write(1, this.window_width, 'BLADDER: ' + game.bladder_pressure);
+ terminal.write(1, this.window_width,
+ 'WEARINESS: ' + game.weariness +
+ ' BLADDER: ' + game.bladder_pressure);
},
draw_history: function() {
let log_display_lines = [];
game.player = game.get_thing(game.player_id)
game.players_hat_chars = game.players_hat_chars_new
game.bladder_pressure = game.bladder_pressure_new
+ game.weariness = game.weariness_new
game.turn_complete = True
if game.tui.mode.name == 'post_login_wait':
game.tui.switch_mode('play')
game.tui.set_random_colors()
cmd_RANDOM_COLORS.argtypes = ''
-def cmd_BLADDER_PRESSURE(game, bladder_pressure):
+def cmd_STATS(game, bladder_pressure, weariness):
game.bladder_pressure_new = bladder_pressure
-cmd_BLADDER_PRESSURE.argtypes = 'int:nonneg'
+ game.weariness_new = weariness
+cmd_STATS.argtypes = 'int:nonneg int:nonneg'
class Game(GameBase):
turn_complete = False
self.register_command(cmd_FOV)
self.register_command(cmd_DEFAULT_COLORS)
self.register_command(cmd_RANDOM_COLORS)
- self.register_command(cmd_BLADDER_PRESSURE)
+ self.register_command(cmd_STATS)
self.map_content = ''
self.players_hat_chars = ''
self.player_id = -1
self.portals_new = {}
self.terrains = {}
self.player = None
- self.bladder_pressure_new = 0
- self.bladder_pressure = 0
def get_string_options(self, string_option_type):
if string_option_type == 'map_geometry':
y += 1
def draw_stats():
- safe_addstr(0, self.window_width, 'BLADDER: ' + str(self.game.bladder_pressure))
+ stats = 'WEARY: %s BLADDER: %s' % (self.game.weariness,
+ self.game.bladder_pressure)
+ safe_addstr(0, self.window_width, stats)
def draw_mode():
help = "hit [%s] for help" % self.keys['help']