From 72fc068844949f4584a7d1fb98b23b10df7e7356 Mon Sep 17 00:00:00 2001 From: belugas Date: Wed, 28 Mar 2007 20:06:28 +0000 Subject: (svn r9520) -Codechange: Add the notion of Industry behaviour. It means what an industry can do (plant fields, cut trees, do not change production), what can be done to it (disasters like mine subsidence, jet/chopper attack), when it can be built etc... --- src/industry.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/industry.h') diff --git a/src/industry.h b/src/industry.h index 829b91c90..8a7970ca0 100644 --- a/src/industry.h +++ b/src/industry.h @@ -6,6 +6,7 @@ #define INDUSTRY_H #include "oldpool.h" +#include "helpers.hpp" typedef byte IndustryGfx; typedef uint8 IndustryType; @@ -21,6 +22,27 @@ enum IndustryLifeType { INDUSTRYLIFE_CLOSABLE, ///< Industry can only close (no production change) }; +enum IndustyBehaviour { + INDUSTRYBEH_NONE = 0, + INDUSTRYBEH_PLANT_FIELDS = 1 << 0, ///< periodically plants fileds around itself (temp and artic farms) + INDUSTRYBEH_CUT_TREES = 1 << 1, ///< cuts trees and produce first output cargo from them (lumber mill) + INDUSTRYBEH_BUILT_ONWATER = 1 << 2, ///< is built on water (oil rig) + INDUSTRYBEH_TOWN1200_MORE = 1 << 3, ///< can only be built in towns larger then 1200 inhabitants (temperate bank) + INDUSTRYBEH_ONLY_INTOWN = 1 << 4, ///< can only be built in towns (arctic/tropic banks, water tower) + INDUSTRYBEH_ONLY_NEARTOWN = 1 << 5, ///< is always built near towns (toy shop) + INDUSTRYBEH_PLANT_ON_BUILT = 1 << 6, ///< Fields are planted around when built (all farms) + INDUSTRYBEH_DONT_INCR_PROD = 1 << 7, ///< do not increase production (oil wells) + INDUSTRYBEH_BEFORE_1950 = 1 << 8, ///< can only be built before 1950 (oil wells) + INDUSTRYBEH_AFTER_1960 = 1 << 9, ///< can only be built after 1960 (oil rigs) + INDUSTRYBEH_AI_AIRSHIP_ROUTES = 1 << 10, ///< ai will attempt to establish air/ship routes to this industry (oil rig) + INDUSTRYBEH_AIRPLANE_ATTACKS = 1 << 11, ///< can be exploded by a military airplane (oil refinery) + INDUSTRYBEH_CHOPPER_ATTACKS = 1 << 12, ///< can be exploded by a military helicopter (factory) + INDUSTRYBEH_CAN_SUBSIDENCE = 1 << 13, ///< can cause a subsidence (coal mine, shaft that collapses) +}; + + +DECLARE_ENUM_AS_BIT_SET(IndustyBehaviour); + /** * Defines the internal data of a functionnal industry */ @@ -71,6 +93,7 @@ struct IndustrySpec { CargoID accepts_cargo[3]; ///< 3 accepted cargos IndustryLifeType life_type; ///< This is also known as Industry production flag, in newgrf specs byte climate_availability; ///< Bitmask, giving landscape enums as bit position + IndustyBehaviour behaviour; ///< How this industry will behave, and how others entities can use it StringID name; ///< Displayed name of the industry StringID new_industry_text; ///< Message appearing when the industry is built StringID closure_text; ///< Message appearing when the industry closes -- cgit v1.2.3-54-g00ecf