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

New electronics #8432

Merged
merged 21 commits into from Aug 12, 2014

Conversation

Projects
None yet
8 participants
@HuXTUS
Copy link
Contributor

commented Aug 4, 2014

New items:

  • Tablet PC with colorful E-Ink display
  • SD-Memory card (encrypted sometimes)
  • Digital cameras

Tablet PC with colorful E-Ink display

This tablet PC has E-Ink display, thus it consumes energy only when user works with it and when playing music.

With this gadget you can:

  • view photos
  • play music
  • view recipes
  • view your monster collection
  • download data from memory card
  • decrypt encrypted memory cards
download data from memory card ( MC )

Insert MC that you found into gadget and try download data. Every MC initialized with random stuff and can be empty, contain family photos, music and/or recipes. Also it can be encrypted. If you lucky, data from MC will appear in your Tablet PC.

decrypt encrypted memory cards

Computer skill needed. You can lost data on MC if you failed, but encrypted MC's has bigger chance to contain data.

view photos

You collect photos on your device from MC's. Then you can view this photos. It increases your morale, but photos consumes from device (like chapters from funny books), and you need search new MC with photos.

play music

Like with photos, you can collect music. Music not consumed from device, but the more music you have, the better for you: maximum of given morale limited by count of songs on device (but can't be more that 100).

May be we need trait "music lover", that increased max of limit?

Activating music on device will set item->active = true and starting consume batteries, device will sound in some radius. If you hear music, your morale increased.

Important: I added new effect music. It work like semaphore to all music-devices (this tablet, mp3 and vehicle music).

Algo:

if (!p->has_effect("music")) {
    p->add_effect("music", 1);
    p->add_morale(MORALE_MUSIC,  ,  ,  ,  );
}
view recipes

If you lucky, you can find (and download to tablet) MC with recipe. In this PR I limited recipes with max=3 level of food recipes, one that does not scare, but you can do any other recipe in future.

upd: new rare item - science memory card. always encrypted, has no limit on recipes.

If your device contain recipes, just select one and it appear on E-Ink display. Now the tablet can be used in crafts like book (but books contains many recipes, but tablet only the selected).

I slightly updated method has_recipe(), now any item in game can contain recipe. Just add tag "HAS_RECIPE" and set item_vars["RECIPE"]="ident"

This gives us the ability to create items (also in realtime) such as:

  • plain paper with a recipe
  • writing set to rewrite the recipe on paper
  • print the recipe on the printer
  • and even artifacts with a prescription. Just for fun we can add in museum stone with recipe craft of stone knife.

Digital cameras

Just for fun. You can take a shot monsters. Photos will produce different quality. Pro camera have better chance to make good photo. You can watch photos on your camera and upload it to MC, then download to tablet PC. You can flashes (do blink) monsters and NPC with camera's flash.

I do not think of why this might be the case, but I like collecting something in games, and here we will be able to collect pictures of monsters.

May be we can create quest (NPC) - "take a shot of Hulk with good quality".


This increases count of electronics you can use, not just disassemble.

@Zireael07

This comment has been minimized.

Copy link
Contributor

commented Aug 4, 2014

Great, keep up the good work!

@HuXTUS

This comment has been minimized.

Copy link
Contributor Author

commented Aug 4, 2014

Thank you, Zireael.

@stk2008

This comment has been minimized.

Copy link

commented Aug 4, 2014

im looking forward to this to looks promising :)

may I suggest some kind of GPS system?.
I know we can find road maps etc but GPS would be cool :)

camera...
just save progress to work in other place
@kevingranade

This comment has been minimized.

Copy link
Member

commented Aug 4, 2014

Wow, that's a bundle of great ideas. I can definitely see people getting
hooked on collecting monster pictures, and having some quests to catalog
the cataclysm. Maybe some scientist NPC who wants to research a monster
type?

@@ -0,0 +1,21 @@
Exception: STATUS_INTEGER_DIVIDE_BY_ZERO at eip=00997536

This comment has been minimized.

Copy link
@kevingranade

kevingranade Aug 5, 2014

Member

please don't check in your stack dumps >_<

This comment has been minimized.

Copy link
@HuXTUS

HuXTUS Aug 5, 2014

Author Contributor

sorry, I hand curves with git. Will clean this as soon as I can.

This file is accidentally slipped when I build the project with cygwin and sent commit.


if (it->has_flag("MC_MOBILE") && it->has_flag("MC_RANDOM_STUFF") && !(it->has_flag("MC_USED") ||
it->has_flag("MC_HAS_DATA")))
{

This comment has been minimized.

Copy link
@kevingranade

kevingranade Aug 5, 2014

Member

brackets please

This comment has been minimized.

Copy link
@HuXTUS

HuXTUS Aug 5, 2014

Author Contributor

yes, yes. Sorry again, this project is WIP, I very much hope that when I finish it and offer to merge, such errors will not. I think I have learned how to use A-Style plugin for MS Visual Studio.

@HuXTUS HuXTUS changed the title New electronics [WIP][discuss] New electronics [CR] Aug 6, 2014

}

if (z.is_hallucination()) {
p->add_msg_if_player(_("Strange, but in the picture anyone..."));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 7, 2014

Contributor

Strange...there's nothing in the picture?

}

if (zid != sel_zid) {
p->add_msg_if_player(m_warning, _("%s standing in the way of the lens."), z.name().c_str());

This comment has been minimized.

Copy link
@KA101

KA101 Aug 7, 2014

Contributor

There's a %s in the way!

}

p->moves -= 50;
g->sound(p->posx, p->posy, 8, _("TODO: SOME SOUND OF PHOTO'SHOT IN ENGLISH."));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 7, 2014

Contributor

click!

const int sel_npcID = g->npc_at(pos.x, pos.y);

if (sel_zid == -1 && sel_npcID == -1) {
p->add_msg_if_player(_("There is no creature to take photo."));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 7, 2014

Contributor

There's nothing particularly interesting there.

}

if (pos.x == p->posx && pos.y == p->posy) {
p->add_msg_if_player(_("To take a selfie is bad idea - flash harmful to the eyes."));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 7, 2014

Contributor

You decide not to flash yourself.

p->add_msg_if_player(m_good, _("Pictures of someone's house, luxuriously."));
break;
default:
p->add_msg_if_player(m_good, _("You nostalgiques staring at the photo."));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 7, 2014

Contributor

You feel nostalgic as you stare at the photo.

@HuXTUS

This comment has been minimized.

Copy link
Contributor Author

commented Aug 11, 2014

...and here. I can't resolve merge conflicts. Hope it not big problem for seasoned collaborators.

@@ -66,6 +66,7 @@ void game::init_morale()
_("Mutagenic Anticipation"),
_("Good Feeling"),
_("Supported"),
_("Looked photos"),

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

Looked at photos

return it->type->charges_to_use();
}
if (!mc->has_flag("MC_MOBILE")) {
p->add_msg_if_player(m_info, _("This is not compatible memory card!"));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

This is not a compatible memory card

uimenu pmenu;

pmenu.selected = 0;
pmenu.text = _("Monsters photo on camera:");

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

Critter photos saved on camera:

}

//just photo, no save. Maybe in the future we will need to create CAMERA_NPC_PHOTOS
p->add_msg_if_player(_("You shot %s in %s quality."), guy->name.c_str(),

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

You took a (quality) photo of (target).

chq = &string_format("%d", photo_quality)[0];
it->item_vars["CAMERA_MONSTER_PHOTOS"][strqpos] = *chq;

p->add_msg_if_player(_("This photo is better than previous."));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

This photo is better than the previous one.

//quest processing...
}

p->add_msg_if_player(_("You shot %s in %s quality."), z.name().c_str(),

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

You took a (quality) photo of (target).

} else {

if (success > -10 || one_in(5)) {
p->add_msg_if_player(m_neutral, _("You failed to decrypt content of %s!"), mc->tname().c_str());

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

You failed to decrypt the %s.

(No exclamation as it's not a serious failing.)

if (success > -10 || one_in(5)) {
p->add_msg_if_player(m_neutral, _("You failed to decrypt content of %s!"), mc->tname().c_str());
} else {
p->add_msg_if_player(m_bad, _("Firmware protection tripped on and the data is lost!"));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

You tripped the firmware protection, and the card deleted its data!

return it->type->charges_to_use();
}
if (!mc->has_flag("MC_MOBILE")) {
p->add_msg_if_player(m_info, _("This is not compatible memory card!"));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

Missing article: not a compatible

return it->type->charges_to_use();
}
if (!mc->has_flag("MC_MOBILE")) {
p->add_msg_if_player(m_info, _("This is not compatible memory card!"));

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

Missing article: not a compatible

it->item_vars["RECIPE"] = recipes[rchoice - 1];

const item dummy(it->item_vars["RECIPE"], 0);
p->add_msg_if_player(m_info, _("Now e-ink screen contains recipe of %s."), dummy.tname().c_str());

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

You change the e-ink screen to show a recipe for %s

p->add_msg_if_player(m_good, _("You download recipe of %s into internal memory"),
dummy.tname().c_str());
} else {
p->add_msg_if_player(m_good, _("Your tablet already has recipe of %s"),

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

...a recipe for %s

something_downloaded = true;
eink->item_vars["EIPC_RECIPES"] += rident + ",";

p->add_msg_if_player(m_good, _("You download recipe of %s into internal memory"),

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

You download a recipe for %s into the tablet's memory

"symbol": ";",
"color": "yellow",
"name": "camera pro",
"description": "Digital camera professional level allows you to take and store pictures. Is display for viewing photos and slot for memory card. Features improved image quality.",

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

A 35mm digital SLR (single-lens reflex) camera, with optical and digital viewfinders, zoom lens with auto-focus and stabilizer, and flash. You can view your photos on it or transfer them with a memory card; it runs on conventional batteries.

Before the cataclysm, you could have taken professional-grade photos using this.

"color": "yellow",
"name": "camera pro",
"description": "Digital camera professional level allows you to take and store pictures. Is display for viewing photos and slot for memory card. Features improved image quality.",
"flags": ["CAMERA_PRO"],

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

I'm imagining my Canon T1i here, and for DDA purposes it would take the "ALWAYS_TWOHAND" flag. ONe hand to work the shutter and controls, one to work the lens (zoom, and focus, if you're focusing manually).

You can one-hand it IRL (mine has a wrist brace that facilitates that), but then the balance is Off and you can't zoom easily, so in practice it should take a nontrivial penalty to photo quality. Seems easier to require two hands ATM.

This comment has been minimized.

Copy link
@HuXTUS

HuXTUS Aug 12, 2014

Author Contributor

Just add tag "ALWAYS_TWOHAND"?

I want to say that the camera now can be used not only holding as weapon, but also by using [ a ] from inventory.

"symbol": ";",
"color": "yellow",
"name": "camera",
"description": "Digital camera allows you to take and store pictures. Is display for viewing photos and slot for memory card.",

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

A point-and-shoot digital camera, with digital viewfinder, a backup "iron-sight", and flash. You can look at your photos on the digital screen, or transfer them with a memory card. Takes conventional batteries.

"color": "yellow",
"name": "camera",
"description": "Digital camera allows you to take and store pictures. Is display for viewing photos and slot for memory card.",
"price": 200000,

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

Uh, my cheap camera cost me about $200. Canon Powershot A1100 IS.

This comment has been minimized.

Copy link
@HuXTUS

HuXTUS Aug 12, 2014

Author Contributor

Ok. Well, I just don't know how the prices are formed and in the DDA. Just a question: are they which were before the cataclysm, or they are formed by supply and demand at the moment? The camera is a big deficit, they are no longer manufactured, must be expensive.

"price": 200000,
"material": ["plastic", "steel"],
"weight": 20000,
"volume": 5,

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

If it's similar to mine, volume 1 at most. Not much bigger than a pack of cards or my hand.

"symbol": ";",
"color": "blue",
"name": "E-Ink Tablet PC",
"description": "Tablet PC with colorful E-Ink display. Useful multifunctional device from pre-apocalypse time. Has display which consumes almost no energy.",

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

A tablet PC using an efficient color e-ink display. Before the cataclysm, these were nifty gadgets; now, it's an almost priceless resource. Runs on conventional batteries.

"color": "white",
"name": "Science SD-Memory card",
"name_plural": "Science SD-Memory cards",
"description": "Memory card you found on dead scientist or laboratory. It is encrypted and may contain some very useful stuff.",

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

This memory card appears to be related to "XEDRA", and is certainly encrypted. Looks * Interesting *, though...

(side note, not for inclusion in the text: XEDRA is the fictional US government agency which controlled the labs, and is directly responsible for the Cataclysm.)

"color": "white",
"name": "SD-Memory card (encrypted)",
"name_plural": "SD-Memory cards (encrypted)",
"description": "Memory card for mobile devices. This card is encrypted, you do not know what it contains.",

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

This memory card appears to have the firmware encryption set. Hopefully it contains something worth encrypting.

"color": "white",
"name": "SD-Memory card (clean)",
"name_plural": "SD-Memory cards (clean)",
"description": "Memory card for mobile devices. This card does not contains any data, but you can still write on it your useful data.",

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

This memory card is either unused or has been wiped clean. You could use it to store your data, though!

"symbol": ",",
"color": "white",
"name": "SD-Memory card",
"description": "Memory card for mobile devices. Usually stores family photo and music, but sometimes you can find something interesting and useful.",

This comment has been minimized.

Copy link
@KA101

KA101 Aug 12, 2014

Contributor

A memory card, used. Might be worth a look.

@kevingranade kevingranade merged commit 7411cd9 into CleverRaven:master Aug 12, 2014

1 check failed

default Unmergeable pull request.
@HuXTUS

This comment has been minimized.

Copy link
Contributor Author

commented Aug 12, 2014

@kevingranade Thanks, Kevin.

Just question: for you it was difficult to resolve merge conflicts here?

And which tool you use for that? kdiff3?

@HuXTUS HuXTUS deleted the HuXTUS:new-electronics branch Aug 12, 2014

"color": "white",
"name": "SD-Memory card (clean)",
"name_plural": "SD-Memory cards (clean)",
"description": "This memory card is either unused or has been wiped clean. You could use it to store your data, though!",

This comment has been minimized.

Copy link
@Lain-

Lain- Aug 12, 2014

Contributor

I'm confused here, the id is "mobile_memory_card_used" but the description suggest that the card is unused. It is possible that this will cause unintended effects in the code but I haven't look yet.

This comment has been minimized.

Copy link
@HuXTUS

HuXTUS Aug 12, 2014

Author Contributor

"used" in id mean that this card is clean. Not new (with unknown data) or not contain your data. In code I do check like

if (card.has_flag(MC_USED)) {this card not contains any data}

heh. look this (last) commit
HuXTUS@7411cd9

This comment has been minimized.

Copy link
@kevingranade

kevingranade Aug 12, 2014

Member

There were a few tricky bits with the merge, there was a conflicting fix to
how music morale gain is handled, and a bunch of the new items conflicted,
which is a scary-looking conflict if you're not used to them.

@HuXTUS

This comment has been minimized.

Copy link
Owner Author

commented on data/json/items/melee.json in 7411cd9 Aug 12, 2014

@Lain- welcome here. This is old version of description. Just it changed by KA101 because it is better to user understood.

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.