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

Add Complete missions dialog function #51820

Merged
merged 3 commits into from
Sep 23, 2021

Conversation

Ramza13
Copy link
Contributor

@Ramza13 Ramza13 commented Sep 23, 2021

Summary

None

Purpose of change

Fixes #30905
Allow custom mission handling to help out I-am-erk

Describe the solution

Describe alternatives you've considered

Testing

Used this json

  {
    "id": "migo_bio_tech",
    "type": "TOOL",
    "name": { "str_sp": "Mi-go Biotech" },
    "description": "A piece of mi-go biotechnology.",
    "weight": "1 g",
    "volume": "250 ml",
    "price": 3000,
    "price_postapoc": 10000,
    "symbol": "!",
    "color": "light_red",
    "use_action": {
      "type": "effect_on_conditions",
      "description": "Touch the opening.",
      "effect_on_conditions": [
        {
          "id": "EOC_MIGO_BIO_TECH_INTEREST",
          "effect": [
            { "assign_mission": "MISSION_HELICOPTER_REFUEL" }
          ]
        }
      ]
    }
    },
    {
      "id": "migo_bio_tech2",
      "type": "TOOL",
      "name": { "str_sp": "Mi-go2 Biotech" },
      "description": "A piece of mi-go biotechnology.",
      "weight": "1 g",
      "volume": "250 ml",
      "price": 3000,
      "price_postapoc": 10000,
      "symbol": "!",
      "color": "light_red",
      "use_action": {
        "type": "effect_on_conditions",
        "description": "Touch the opening.",
        "effect_on_conditions": [
          {
            "id": "EOC_MIGO_BIO_TECH_INTEREST2",
            "effect": [
              { "finish_mission": "MISSION_HELICOPTER_REFUEL", "success":true }
            ]
          }
        ]
      }
  }

Additional context

@actual-nh actual-nh added <Enhancement / Feature> New features, or enhancements on existing [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Effects / Skills / Stats Effects / Skills / Stats Missions Quests and missions labels Sep 23, 2021
@I-am-Erk
Copy link
Member

With this, we can use dialogue conditionals to do a ton of cool things:

  • get a mission from one NPC that you complete on contact via another NPC, or even an EOC from activating an item or other
  • get a mission that is completed through any manner of dialogue conditionals... for example, if you have one of this item and interact with this piece of furniture, an eoc trigger can remove the item and complete the mission and ran an update_mapgen (eg. mission to plug a usb key into a computer)
  • have npcs with multiple nonlinear missions, eg. a quest line around maknig contact with and dealing with multiple different factions at once

@I-am-Erk I-am-Erk merged commit 947f8d7 into CleverRaven:master Sep 23, 2021
I-am-Erk added a commit to I-am-Erk/Cataclysm-DDA that referenced this pull request Sep 23, 2021
* reorganized to support expansion

* reorganized to support expansion

* removed sentences that shouldn't be there

* fixed log stable appearing as kitchen construction

* Reworked to push expansions back to the top level + doc

* testing disallows base name recipe changes

* removal of characters in middle of token managed to offend secret json format mandate

* Adjusted to CleverRaven#46278

* incorporated some old reverse conflict changes

* reorganized the stuff added while this PR was suspended

* reorganized the stuff added while this PR was suspended

* Fix bike shop variant roof

Fix the bike shop variant 1 having an empty roof

* Change stairs to ladder

Changed stairs down to ladder down

* Update the table of contents

* Remove duplicate shortcut keys from interaction menu

Fixes CleverRaven#51772

Co-authored-by: David Seguin <[email protected]>

* Jsonified dead scientists map extra

* Use string_id for update_mapgen and nested_mapgen

These ids were previously just using strings; better to use a dedicated
string_id type.

This required adding an actual type for the string_id to point to in
each case, wrapping the collection of mapgen_function_json objects.

* Update cooking_components.json

* Force recipes to provide (sub)category

As suggested in CleverRaven#50866, require all recipe definitions to provide a
category and subcategory when loading from JSON.

* Add subcategory to Magiclysm recipe

* Clarify description of mon_zombie_dog (CleverRaven#51801)

See <https://discord.com/channels/598523535169945603/598614717799596055/890213920957161472> on the dev discord.

* Test disabling expensive LGTM checks (CleverRaven#51806)

Disable one LGTM checks to see if there's hope of reducing the runtime
thereby.

* Mythos Mod Resubmission (CleverRaven#51796)

* Mythos Mod Resubmission

* Remove Occulti as maintainer

* Fix typo in "Storehouse survey" blueprint name

* Add dialog activity functions, and flag to prevent activity being interrupted (CleverRaven#51809)

* Add dialog stuff

* docs

* Update player_activities.json

* use snippets (CleverRaven#51663)

Co-authored-by: Saicchi <[email protected]>
Co-authored-by: Kevin Granade <[email protected]>

* Blacksmithing tongs and cooking tongs are two diffrent things.  (CleverRaven#51672)

* Add blacksmithing tongs.

The tongs in game wouldn't be able to carry around a four kilo zweihander. They are designed for cooking and flipping food, so they are very lightweight and thing, they would most likely bend under the heat of the hot metal.

* Added the need to use blacksmithing (flatjaw) tongs for the Zweihander

Not using tongs for smithing is almost impossible.

* Change the blacksmithing toolset to include the tongs.

I also removed the tongs from the tools on the zweihander.

Co-authored-by: Anton Burmistrov <[email protected]>
Co-authored-by: Kevin Granade <[email protected]>

* More granular json-style and astyle (CleverRaven#51731)

* More granular json-style and astyle

* Melee practice and training dummies (CleverRaven#51598)

* Melee practice
Added some basic melee practice recipes, including 2 for training dodge.
* Training dummy for practice recipes
* Dummy recipe and resolve problems
* Intermediate recipes and heavy training dummy
* Changed the armored dummy recipe
The recipe is inspired by the scrap suit recipe.
* Added tanto as a possible weapon for stabbing training
* Punching bag

Co-authored-by: Marloss <[email protected]>

* Write documentation for neighbor based chunk spawning (CleverRaven#51818)

* Resubmit Fix Tire Rims (CleverRaven#51798)

* Update goblin.json (CleverRaven#51799)

* Fix: Force stereo when opening audio device (CleverRaven#51754)

Co-authored-by: Kevin Granade <[email protected]>

* Add support for weakpoint damage and crit multipliers (CleverRaven#51770)

* Weakpoints (Part 4.5): Add support for JSON inheritance and default weakpoints (CleverRaven#51822)

* Let contributors specify the default weakpoint, by providing an empty ID

* Add support for weakpoint inheritance.

* Reduce debug.log file size by folding consecutive identical errors (CleverRaven#51791)

* debug_fold_repetition: Fold identical errors to reduce log spam

* debug_fold_repetition: added timestamp and timeout

timestamp for repeated error folding group is that of the last folded
error
timeout is currently hardcoded to 100ms. If another repeated error is
registered that would be folded but is >100ms after the previous error
it starts a new folding group

* debug_fold_repetitions: bookended fold for readability, made output DRY

It's a little easier to read the log as `[First]<folded>[Last]` than
`[First]<folded with last timestamp>`
Need to test folding output during deinit and DebugLog, made a function
to remove repetition.

* debug_fold_repetitions: excess repetition error to forced prompt

As logged error the excessive repetition error causes breaks in folds
which make debug.log less clear while reading, and does not add information
Forced prompting once excess threshold is reached will prompt once per
excessive repetition set.

* Allow using any tool with the drilling quality to make a draw_plate (CleverRaven#51794)

Fixes CleverRaven#51688

* The (impotent) Sound and the Fury (CleverRaven#51803)

* update m231

Updated price(https://www.invaluable.com/auction-lot/incredibly-rare-colt-m231-port-firing-u-s-propert-2086-c-3574a02a1e), adjusted desc, set sight disp to that of other no-sight guns, adjusted mod locations.

* Rapidly changing light levels do not grant max vision to turrets (CleverRaven#51815)

* Update fake.json (CleverRaven#51819)

* Fix process effects crash (CleverRaven#51827)

* Add Complete missions dialog function (CleverRaven#51820)

* Complete missions

* Update npctalk.cpp

* Update npctalk.cpp

Co-authored-by: PatrikLundell <[email protected]>
Co-authored-by: SegaSaturnity <[email protected]>
Co-authored-by: kevingranade <[email protected]>
Co-authored-by: UmbralReaper <[email protected]>
Co-authored-by: David Seguin <[email protected]>
Co-authored-by: Valiant <[email protected]>
Co-authored-by: John Bytheway <[email protected]>
Co-authored-by: mythosmod <[email protected]>
Co-authored-by: Kevin Granade <[email protected]>
Co-authored-by: actual-nh <[email protected]>
Co-authored-by: Angela Graves <[email protected]>
Co-authored-by: Binrui Dong <[email protected]>
Co-authored-by: Eric <[email protected]>
Co-authored-by: Saicchi <[email protected]>
Co-authored-by: Saicchi <[email protected]>
Co-authored-by: GOFLUMPYOURSELFPORCAY <[email protected]>
Co-authored-by: Termineitor244 <[email protected]>
Co-authored-by: Marloss <[email protected]>
Co-authored-by: Zhilkin Serg <[email protected]>
Co-authored-by: John Candlebury <[email protected]>
Co-authored-by: The SzQ <[email protected]>
Co-authored-by: Joshua Chin <[email protected]>
Co-authored-by: OrenAudeles <[email protected]>
Co-authored-by: Tonkatsu <[email protected]>
Co-authored-by: Roy Berube <[email protected]>
Co-authored-by: ISuckM8 <[email protected]>
Co-authored-by: ferociousdork <[email protected]>
@Ramza13 Ramza13 deleted the mission_dialog branch September 24, 2021 00:02
@I-am-Erk
Copy link
Member

So, when I hand my anesthesia kits over to Rubik and activate the complete quest effect, I get the following message:
image

It may be unrelated, but I can't see anything else in the dialogue that would cause that:

      {
        "text": "I've brought those anaesthetic kits for you.  Can you help me out?",
        "condition": { "and": [ { "u_has_items": { "item": "anesthetic_kit", "count": 2 } }, { "u_has_mission": "RUBIK_ANUS_FETICK" } ] },
        "effect": [
          { "u_sell_item": "anesthetic_kit", "count": 2 },
          { "finish_mission": "RUBIK_ANUS_FETICK", "success": true }
        ],
        "topic": "TALK_EXODII_MERCHANT_ExodizeMe2"
      }

Any ideas?

@I-am-Erk
Copy link
Member

I-am-Erk commented Sep 24, 2021

Curiously, when I had extra anesthesia kits on my person it did not give me that message. Not when Rubik has extra kits though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Mechanics: Effects / Skills / Stats Effects / Skills / Stats Missions Quests and missions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better mission integration into dialogue
3 participants