Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Things to do - new computer refactor #7

Open
vache opened this issue Nov 13, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@vache
Copy link
Owner

commented Nov 13, 2014

TODO:

  • Fix rotation
  • Implement new actions and securities
  • Fix the myriad of possible memory leaks
  • Implement json loading of legacy actions
  • Finalize output format (inline jsoning?)
  • Finalize input reading (swapping between legacy and non legacy)
  • Add json shape system to let some things cover areas (add_field, etc)
  • Write up a guide to adding computers
  • Finish the national computer test center, fill with examples of each computer action
  • Add template system
  • Add optional failure-security association
  • Add optional failure distribution/combination system
  • Add optional security to access the computer

Sample JSON:

"place_computer":{
    "x":1,
    "y":2,
    "name":"Security Terminal",
    "prompt":"Authorized Access Only.  Please insert ID and enter password.",
    "options":[{
        "prompt":"Open door",
        "security":[
            { "security":"has_item", "item":"it_keycard", "count":1},
            { "security":"hack", "skill":3}],
        "actions":[
            { "action":"ch_ter", "loc":[3, 4], "ter":"t_door_open" },
            { "action":"msg", "msg":"Door Opened"}],
        "failures":[
            { "action":"sound", "volume":25, "msg":"an alarm sounds" },
            { "action":"shutdown" }]
         },{
        "prompt":"Close door",
        "security":[
            { "security":"has_item", "item":"it_keycard", "count":1},
            { "security":"hack", "skill":3}],
        "actions":[
            { "action":"ch_ter", "loc":[3, 4], "ter":"t_door_closed" },
            { "action":"msg", "msg":"Door Closed"}],
        "failures":[
            { "action":"sound", "volume":25, "msg":"an alarm sounds" },
            { "action":"shutdown" }]
        }]
}

This creates a computer at (1,2) (note: computer terrain must still be set in bindings), that displays:

Security Terminal
Authorized Access Only
1 - Open Door
2 - Close Door

Selecting option 1 will prompt the player to hack the terminal and check if the player has a keycard. If they fail, an alarm will sound and the terminal will shutdown, otherwise, the door at (3,4) will open, and the screen will display the message "Door Opened". Selecting option 2 does the same, but will close the door if the security attempt is passed.

In example proposed above, if the player did not have the keycard, the system would do the entire set of failures, even though it only makes sense to punish the player for the failed hack attempt, not the missing keycard. Also, system does not support alternates. IE. player must have password OR pass hack attempt, player must have keycard OR pass electronics attempt.

Possible solution:
Associate individual failure actions with security tasks, and have an exposition message on the computer screen. Computers with a combination security requires every single "requirement" to pass. Option security requires at least one "alternate" to pass. They can be nested. It ends up looking annoyingly complicated, and there's probably a more elegant way of doing this, but I don't know it. Instead of a series of combinations like this, find places where it makes sense, then make combined checks for those. Ex: instead of PASSWORD_CHECK or HACK_CHECK make PASSWORD_OR_HACK in one check.

"security":[
    {"type":"combination", "requirements": [
        {
            "type":"option", "alternates":[
                { "security":"has_item", "item":"it_keycard", "count":1,
                    "failaction":{ "action":"msg", "message":"Insert a valid ID card."} },
                { "security":"skill_check", "skill":"electronics", "skill":6,
                    "failaction":{ "action":"shutdown"} } ]
        },{
            "type":"option", "alternates":[
                { "security":"password", "code":"LETMEIN", 
                    "failaction":{ "action":"msg", "message":"Invalid Password."} },
                { "security":"skill_check", "skill":"electronics", "skill":6,
                    "failaction":{ "action":"shutdown"} } ]
        }]
    }
Security Terminal
Authorized Access Only
1 - Open Door (Requires Keycard and Password Authorization)
2 - Close Door (Requires Keycard and Password Authorization)
> 1
No access without keycard.  Attempt to bypass?
> Y
(Pass electronics check)
This system requires a password to continue.  Attempt to hack?
> Y
(Fail computer check)
Unauthorized access detected.  Shutting down.

Simplifications to code:
Condense computers down into certain templates that can be called simply. Example:

{
    "type":"computer",
    "loc":[1,2],
    "template":"messages",
    "prompt":"Bob's PC",
    "messages":[
        {"subject":"RE: living dead?", "msg":"Dude youre crazy zombies are sci fi man"},
        {"subject":"flu", "msg":"i got the flu man, can you take my shift tomorrow night?"},
        {"subject":"preparing...", "msg":"the guns are hidden under the bed", "hack":3}
    ]
}
{
    "type":"computer",
    "loc":[1,2],
    "template":"door",
    "prompt":"Security Terminal",
    "targets":[
        {"open_prompt":"Disengage Lock?", "close_prompt":"Engage Lock?", "loc":[3,3], "diff":5 ,
            "closed_terrain":"t_door_locked", "open_terrain":"t_door_open"}
    ]
}

Other issues:
Setting distribution of failures with a range of values. Ex. attempting lvl 10 lock at lvl 0 computers gives a high chance for a critical failure which will shut down system, failing same attempt at lvl 9 is a mild failure that just boots user, or locks system out for a short period.

@vache

This comment has been minimized.

Copy link
Owner Author

commented Dec 17, 2014

New computer actions:

  • Learn recipe (random, random within skill, min/max difficulty, min/max count)
  • Remove monster (without kill)
  • Remove diseases (targeted or general)
  • Elapse time (for things like the training below, and maybe a short time for each action taken as part of accessing computer in general)
  • Train skill/remove rust (practice/sim type stuff only?)
  • Deactivate bionics
  • Reactivate bionics
  • Install bionics (maybe)
  • Toggle hostility (for robots and stuff)
  • Remove disease (maybe?)
  • Heal (body part or all, min/max amount)
  • Reduce pain (may integrate with cause pain action, maybe mod_pain)
  • Translate terrain (old terrain -> new terrain, with shape system)
  • Set furniture
  • Translate furniture (not worthwhile until shape system in)
  • Trigger cooldown
  • Add/remove morale
  • Diagnosis (sort of like blood analysis cbm)
  • Add computer option
  • Remove this option (use action to set a bool in computer to trigger removal from the set of options)
  • Remove all options (difficult to specify single non-active option to remove)
  • Add/Remove/Set radiation?

New computer security:

  • Has bionic
  • Does not have excessive mutations (needs more framework to support this)
  • Charge card with $x
  • Check cooldown
  • Does not have disease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.