Unciv/Developers/Uniques/index.html

1613 lines
36 KiB
HTML

<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link rel="canonical" href="https://yairm210.github.io/Unciv/Developers/Uniques/">
<link rel="prev" href="../Unique-replacement-process/">
<link rel="next" href="../../Modders/Mods/">
<link rel="icon" href="../../assets/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.20">
<title>Uniques - Unciv</title>
<link rel="stylesheet" href="../../assets/stylesheets/main.e53b48f4.min.css">
<link rel="stylesheet" href="../../assets/stylesheets/palette.06af60db.min.css">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
<style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
</head>
<body dir="ltr" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="amber">
<input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
<input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
<label class="md-overlay" for="__drawer"></label>
<div data-md-component="skip">
<a href="#uniques" class="md-skip">
Skip to content
</a>
</div>
<div data-md-component="announce">
</div>
<header class="md-header md-header--shadow" data-md-component="header">
<nav class="md-header__inner md-grid" aria-label="Header">
<a href="../.." title="Unciv" class="md-header__button md-logo" aria-label="Unciv" data-md-component="logo">
<img src="../../assets/Icon.png" alt="logo">
</a>
<label class="md-header__button md-icon" for="__drawer">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
</label>
<div class="md-header__title" data-md-component="header-title">
<div class="md-header__ellipsis">
<div class="md-header__topic">
<span class="md-ellipsis">
Unciv
</span>
</div>
<div class="md-header__topic" data-md-component="header-topic">
<span class="md-ellipsis">
Uniques
</span>
</div>
</div>
</div>
<form class="md-header__option" data-md-component="palette">
<input class="md-option" data-md-color-media="" data-md-color-scheme="default" data-md-color-primary="teal" data-md-color-accent="amber" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_0">
<label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_1" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a7 7 0 0 0-7 7c0 2.38 1.19 4.47 3 5.74V17a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-2.26c1.81-1.27 3-3.36 3-5.74a7 7 0 0 0-7-7M9 21a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1v-1H9z"/></svg>
</label>
<input class="md-option" data-md-color-media="" data-md-color-scheme="slate" data-md-color-primary="teal" data-md-color-accent="amber" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_1">
<label class="md-header__button md-icon" title="Switch to light mode" for="__palette_0" hidden>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 2a7 7 0 0 1 7 7c0 2.38-1.19 4.47-3 5.74V17a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1v-2.26C6.19 13.47 5 11.38 5 9a7 7 0 0 1 7-7M9 21v-1h6v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1m3-17a5 5 0 0 0-5 5c0 2.05 1.23 3.81 3 4.58V16h4v-2.42c1.77-.77 3-2.53 3-4.58a5 5 0 0 0-5-5"/></svg>
</label>
</form>
<script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
<label class="md-header__button md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
</label>
<div class="md-search" data-md-component="search" role="dialog">
<label class="md-search__overlay" for="__search"></label>
<div class="md-search__inner" role="search">
<form class="md-search__form" name="search">
<input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
<label class="md-search__icon md-icon" for="__search">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
</label>
<nav class="md-search__options" aria-label="Search">
<button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
</button>
</nav>
</form>
<div class="md-search__output">
<div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
<div class="md-search-result" data-md-component="search-result">
<div class="md-search-result__meta">
Initializing search
</div>
<ol class="md-search-result__list" role="presentation"></ol>
</div>
</div>
</div>
</div>
</div>
<div class="md-header__source">
<a href="https://github.com/yairm210/unciv" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M252.8 8C114.1 8 8 113.3 8 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C436.2 457.8 504 362.9 504 252 504 113.3 391.5 8 252.8 8M105.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg>
</div>
<div class="md-source__repository">
yairm210/unciv
</div>
</a>
</div>
</nav>
</header>
<div class="md-container" data-md-component="container">
<main class="md-main" data-md-component="main">
<div class="md-main__inner md-grid">
<div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
<label class="md-nav__title" for="__drawer">
<a href="../.." title="Unciv" class="md-nav__button md-logo" aria-label="Unciv" data-md-component="logo">
<img src="../../assets/Icon.png" alt="logo">
</a>
Unciv
</label>
<div class="md-nav__source">
<a href="https://github.com/yairm210/unciv" title="Go to repository" class="md-source" data-md-component="source">
<div class="md-source__icon md-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 7.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2025 Fonticons, Inc.--><path d="M173.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M252.8 8C114.1 8 8 113.3 8 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C436.2 457.8 504 362.9 504 252 504 113.3 391.5 8 252.8 8M105.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1m-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7m32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1m-11.4-14.7c-1.6 1-1.6 3.6 0 5.9s4.3 3.3 5.6 2.3c1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2"/></svg>
</div>
<div class="md-source__repository">
yairm210/unciv
</div>
</a>
</div>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../.." class="md-nav__link">
<span class="md-ellipsis">
Welcome to Unciv!
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Credits/" class="md-nav__link">
<span class="md-ellipsis">
Credits
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Guiding-Principles/" class="md-nav__link">
<span class="md-ellipsis">
Guiding Principles
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Privacy-Policy/" class="md-nav__link">
<span class="md-ellipsis">
Privacy Policy
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" checked>
<label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
<span class="md-ellipsis">
Developers
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="true">
<label class="md-nav__title" for="__nav_5">
<span class="md-nav__icon md-icon"></span>
Developers
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../Building-Locally/" class="md-nav__link">
<span class="md-ellipsis">
Building Locally
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../Coding-standards/" class="md-nav__link">
<span class="md-ellipsis">
Coding standards
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../From-code-to-deployment/" class="md-nav__link">
<span class="md-ellipsis">
From code to deployment
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../Game-Making-Tips/" class="md-nav__link">
<span class="md-ellipsis">
Game Making Tips
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../Map-rendering/" class="md-nav__link">
<span class="md-ellipsis">
Map rendering
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../Project-structure-and-major-classes/" class="md-nav__link">
<span class="md-ellipsis">
Project structure
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../Saved-games-and-transients/" class="md-nav__link">
<span class="md-ellipsis">
Saved games and transients
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../Testing-Android-Builds/" class="md-nav__link">
<span class="md-ellipsis">
Building for and testing on Android
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../Translations%2C-mods%2C-and-modding-freedom-in-Open-Source/" class="md-nav__link">
<span class="md-ellipsis">
Translations, mods, and modding freedom in Open Source
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../UI-development/" class="md-nav__link">
<span class="md-ellipsis">
UI Development
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../Unique-replacement-process/" class="md-nav__link">
<span class="md-ellipsis">
Unique replacement process
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--active">
<input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
<label class="md-nav__link md-nav__link--active" for="__toc">
<span class="md-ellipsis">
Uniques
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<a href="./" class="md-nav__link md-nav__link--active">
<span class="md-ellipsis">
Uniques
</span>
</a>
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#what-modders-need-to-know" class="md-nav__link">
<span class="md-ellipsis">
What Modders Need To Know
</span>
</a>
<nav class="md-nav" aria-label="What Modders Need To Know">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#conditionals-and-modifiers" class="md-nav__link">
<span class="md-ellipsis">
Conditionals and Modifiers
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#triggerable-uniques" class="md-nav__link">
<span class="md-ellipsis">
Triggerable Uniques
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#what-developers-need-to-know" class="md-nav__link">
<span class="md-ellipsis">
What Developers Need To Know
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
<label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
<span class="md-ellipsis">
Modders
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6">
<span class="md-nav__icon md-icon"></span>
Modders
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../Modders/Mods/" class="md-nav__link">
<span class="md-ellipsis">
Introduction to Mods
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Making-a-new-Civilization/" class="md-nav__link">
<span class="md-ellipsis">
'My first mod' - Making a new Civilization
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Images-and-Audio/" class="md-nav__link">
<span class="md-ellipsis">
Images and Audio
</span>
</a>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_4" >
<label class="md-nav__link" for="__nav_6_4" id="__nav_6_4_label" tabindex="0">
<span class="md-ellipsis">
Mod file structure
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_4_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6_4">
<span class="md-nav__icon md-icon"></span>
Mod file structure
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../Modders/Mod-file-structure/1-Overview/" class="md-nav__link">
<span class="md-ellipsis">
Mod file structure Overview
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Mod-file-structure/2-Civilization-related-JSON-files/" class="md-nav__link">
<span class="md-ellipsis">
Civilization-related JSON files
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Mod-file-structure/3-Map-related-JSON-files/" class="md-nav__link">
<span class="md-ellipsis">
Map-related JSON files
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Mod-file-structure/4-Unit-related-JSON-files/" class="md-nav__link">
<span class="md-ellipsis">
Unit-related JSON files
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Mod-file-structure/5-Miscellaneous-JSON-files/" class="md-nav__link">
<span class="md-ellipsis">
Miscellaneous JSON files
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6_5" >
<label class="md-nav__link" for="__nav_6_5" id="__nav_6_5_label" tabindex="0">
<span class="md-ellipsis">
Special Mods
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="2" aria-labelledby="__nav_6_5_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_6_5">
<span class="md-nav__icon md-icon"></span>
Special Mods
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../Modders/Creating-a-custom-tileset/" class="md-nav__link">
<span class="md-ellipsis">
Creating a custom tileset
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Creating-a-UI-skin/" class="md-nav__link">
<span class="md-ellipsis">
Creating a UI skin
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="../../Modders/Unique-parameters/" class="md-nav__link">
<span class="md-ellipsis">
Unique parameters
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/uniques/" class="md-nav__link">
<span class="md-ellipsis">
Uniques
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Type-checking/" class="md-nav__link">
<span class="md-ellipsis">
Type checking
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Scenarios/" class="md-nav__link">
<span class="md-ellipsis">
Scenarios
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Modders/Autoupdates/" class="md-nav__link">
<span class="md-ellipsis">
Autoupdates
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item md-nav__item--nested">
<input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
<label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
<span class="md-ellipsis">
Other
</span>
<span class="md-nav__icon md-icon"></span>
</label>
<nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
<label class="md-nav__title" for="__nav_7">
<span class="md-nav__icon md-icon"></span>
Other
</label>
<ul class="md-nav__list" data-md-scrollfix>
<li class="md-nav__item">
<a href="../../Other/Force-rating-calculation/" class="md-nav__link">
<span class="md-ellipsis">
Force rating calculation
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Other/Installing-on-macOS/" class="md-nav__link">
<span class="md-ellipsis">
Installing on MacOS
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Other/Intentional-departures-from-Civ-V/" class="md-nav__link">
<span class="md-ellipsis">
Intentional departures from Civ V
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Other/Multiplayer/" class="md-nav__link">
<span class="md-ellipsis">
Multiplayer
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Other/Regions/" class="md-nav__link">
<span class="md-ellipsis">
Regions
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Other/Simulations/" class="md-nav__link">
<span class="md-ellipsis">
Simulations
</span>
</a>
</li>
<li class="md-nav__item">
<a href="../../Other/Translating/" class="md-nav__link">
<span class="md-ellipsis">
Translating
</span>
</a>
</li>
</ul>
</nav>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
<div class="md-sidebar__scrollwrap">
<div class="md-sidebar__inner">
<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
<label class="md-nav__title" for="__toc">
<span class="md-nav__icon md-icon"></span>
Table of contents
</label>
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
<li class="md-nav__item">
<a href="#what-modders-need-to-know" class="md-nav__link">
<span class="md-ellipsis">
What Modders Need To Know
</span>
</a>
<nav class="md-nav" aria-label="What Modders Need To Know">
<ul class="md-nav__list">
<li class="md-nav__item">
<a href="#conditionals-and-modifiers" class="md-nav__link">
<span class="md-ellipsis">
Conditionals and Modifiers
</span>
</a>
</li>
<li class="md-nav__item">
<a href="#triggerable-uniques" class="md-nav__link">
<span class="md-ellipsis">
Triggerable Uniques
</span>
</a>
</li>
</ul>
</nav>
</li>
<li class="md-nav__item">
<a href="#what-developers-need-to-know" class="md-nav__link">
<span class="md-ellipsis">
What Developers Need To Know
</span>
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<div class="md-content" data-md-component="content">
<article class="md-content__inner md-typeset">
<h1 id="uniques">Uniques</h1>
<h2 id="what-modders-need-to-know">What Modders Need To Know</h2>
<p>Objects in the game - terrains, units, buildings, improvements, etc - differ by their stats, but what makes them truly different mechanically are their special abilities, or as we call them - <em>Uniques</em>.</p>
<p>Each game object can have any number of these Uniques.</p>
<p>The different possible types of uniques are available <a href="../../Modders/uniques/">here</a>, with each unique having a string value, e.g. <code>"Gain [amount] [stat/resource]"</code></p>
<p>These are unique types, because they are in fact <em>templates</em> for possible <em>concrete</em> uniques, where the parameters in square brackets are filled in with specific values - e.g. <code>"Gain [20] [Gold]"</code>
Game objects should have <em>concrete</em> uniques (parameters filled in)</p>
<p>Every parameter in square brackets, is defined by its type, a list of which is available <a href="../../Modders/Unique-parameters/">here</a> - each parameter type has its own text value, e.g. "amount" means an integer.
That determines possible values that this parameter can contain, e.g. "amount" should only contain strings that can be serialized as integers.</p>
<p>Concrete uniques that contain <em>incorrect values</em> (e.g. <code>"Gain [three] [money]"</code>) are warned against in the mod checker, and if they're serious enough, also when starting a new game with the mod</p>
<p>Sometimes uniques are deprecated - Unciv provides autoupdating, meaning you only need to click a button to update the deprecated uniques in your mod!</p>
<h3 id="conditionals-and-modifiers">Conditionals and Modifiers</h3>
<p>Uniques can be modified to do certain things, using special Uniques that are shown in the <a href="../../Modders/uniques/">uniques list</a> within <code>&lt;these brackets&gt;</code>.</p>
<p>This is done by adding these modifiers after the unique like so: <code>"Gain [30] [Gold] &lt;after discovering [Steam Power]&gt;"</code></p>
<p>The most common type of modifier is a conditional - basically limiting the unique to only apply under certain conditions - so all modifiers are sometimes refered to as conditionals.</p>
<p>Other more specialized types of modifiers exist:</p>
<ul>
<li>Triggerable uniques can get <em>under what circumstances they activate</em></li>
<li>Unit actions can get <em>costs, side effects, and limited uses</em></li>
</ul>
<p>As you can see, these conditionals <em>also</em> can contain parameters, and these follow the same rules for parameters as the regular uniques.</p>
<h3 id="triggerable-uniques">Triggerable Uniques</h3>
<p>Most uniques are long-term effects - they apply as long as you have the object containing them (building, resource, tech, policy).
Trigger uniques are different - they are one-time effects, but which may be triggered several times.</p>
<p>Trigger uniques come in two flavors - <a href="../../Modders/uniques/#triggerable-uniques">civ-wide triggers</a> and <a href="../../Modders/uniques/#unittriggerable-uniques">unit-wide triggers</a>.
Unit triggerables are only relevant in the context of a specific unit, so they can be attached to units, promotions or unit types.</p>
<p>Any triggerable unique added to a unit which has <a href="../../Modders/uniques/#unitactionmodifier-uniques">unit action modifiers</a> will be considered as a unit action.
Unit actions can contain civ-wide effects as well.</p>
<p>Trigger uniques specify their activation with trigger conditions.
Like the triggers themselves, these come in two flavors - <a href="../../Modders/uniques/#triggercondition-uniques">civ-wide conditions</a> and <a href="../../Modders/uniques/#unittriggercondition-uniques">unit-wide conditions</a>.
Trigger uniques with no trigger modifiers are activated upon construction (units, buildings, improvements) or discovery (techs, policies). </p>
<p>Events are a ruleset object that act as a sort of "extended trigger" - they are activated by the <code>"Triggers a [event] event"</code> unique, and they trigger other uniques depending on user choice.</p>
<h2 id="what-developers-need-to-know">What Developers Need To Know</h2>
<p>We parse the unique by comparing the string given by the modder minus square bracket contents, to the known list of uniques.
If we find a match - Congrats, we set that as the unique type.</p>
<p>When we check for uniques in the code, it's always for uniques of a specific type, so we can just check the 'unique type' we previously assigned</p>
<p>We then take the parameters of that unique, which we also determined previously by scanning for all strings within square brackets, and use their values in determining the effect of the unique</p>
<p>There is a LOT of caching involved everywhere to make this all as fast as possible, but you really don't need to worry about that, that's my job ;)</p>
</article>
</div>
<script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
</div>
</main>
<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<div class="md-copyright">
Made with
<a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
Material for MkDocs
</a>
</div>
</div>
</div>
</footer>
</div>
<div class="md-dialog" data-md-component="dialog">
<div class="md-dialog__inner md-typeset"></div>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": [], "search": "../../assets/javascripts/workers/search.973d3a69.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
<script src="../../assets/javascripts/bundle.f55a23d4.min.js"></script>
</body>
</html>