├── .gitignore ├── LICENSE ├── New-Mod.sln ├── NewMod ├── Buttons │ ├── AssignButton.cs │ ├── CaptureButton.cs │ ├── DrainButton.cs │ ├── FakeBodyButton.cs │ ├── NecromancerButton.cs │ └── ShowScreenshotButton.cs ├── CustomColor │ └── NewModColor.cs ├── CustomGameModes │ └── RevivalRoyale.cs ├── CustomRPC.cs ├── DebugWindow.cs ├── DiscordStatus.cs ├── MissionType.cs ├── Modifiers │ └── ExplosiveModifier.cs ├── NewMod.cs ├── NewMod.csproj ├── NewModAsset.cs ├── NewModEndReasons.cs ├── Options │ ├── GeneralOption.cs │ └── Roles │ │ ├── EnergyThiefOptions │ │ └── EnergyThiefOptions.cs │ │ ├── NecromancerOptions │ │ └── NecromancerRoleOption.cs │ │ ├── PranksterOptions │ │ └── PranksterOptions.cs │ │ ├── SpecialAgentOptions │ │ └── SpecialAgentOptions.cs │ │ └── TheVisionaryOptions │ │ └── TheVisionaryOptions.cs ├── Patches │ ├── EndGamePatch.cs │ ├── HauntMenuMinigamePatch.cs │ ├── LogoPatch.cs │ ├── QuitPatch.cs │ ├── Roles │ │ ├── EnergyThief │ │ │ └── OnGameEnd.cs │ │ ├── MeetingHudPatch.cs │ │ ├── Prankster │ │ │ └── DeadBodyPatch.cs │ │ └── Visionary │ │ │ └── VisionaryPatches.cs │ └── StatsPopupPatch.cs ├── PendingEffectManager.cs ├── Resources │ ├── Arrow.png │ ├── Logo.png │ ├── Revive2.png │ ├── cam.png │ ├── deadbody.png │ └── optionImage.png ├── Roles │ ├── CrewmateRoles │ │ ├── DoubleAgent.cs │ │ └── TheVisionary.cs │ ├── ImpostorRoles │ │ └── Necromancer.cs │ └── NeutralRoles │ │ ├── EnergyThief.cs │ │ ├── Prankster.cs │ │ └── SpecialAgent.cs └── Utilities │ ├── CoroutinesHelper.cs │ ├── PranksterUtilities.cs │ ├── Utils.cs │ └── VisionaryUtilities.cs ├── README.md └── nuget.config /.gitignore: -------------------------------------------------------------------------------- 1 | bin/ 2 | obj/ 3 | References/ 4 | /packages/ 5 | riderModule.iml 6 | .idea 7 | /tools 8 | .vscode 9 | *.DotSettings.user -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /New-Mod.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.002.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NewMod", "NewMod\NewMod.csproj", "{FC05DD49-CE3A-41F4-8452-37686FE23D0A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {FC05DD49-CE3A-41F4-8452-37686FE23D0A}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {5C4EAAF3-F5BA-4BFF-8F9A-F7735570C5BA} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /NewMod/Buttons/AssignButton.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using MiraAPI.GameOptions; 5 | using MiraAPI.Hud; 6 | using MiraAPI.Utilities.Assets; 7 | using NewMod.Options.Roles.SpecialAgentOptions; 8 | using NewMod.Roles.NeutralRoles; 9 | using UnityEngine; 10 | using AmongUs.GameOptions; 11 | using Object = UnityEngine.Object; 12 | using NewMod.Utilities; 13 | using Reactor.Utilities; 14 | 15 | namespace NewMod.Buttons 16 | { 17 | [RegisterButton] 18 | public class AssignButton : CustomActionButton 19 | { 20 | public override string Name => "ASSIGN MISSION"; 21 | public override float Cooldown => OptionGroupSingleton.Instance.AssignCooldown; 22 | public override int MaxUses => (int)OptionGroupSingleton.Instance.AssignMaxUses; 23 | public override ButtonLocation Location => ButtonLocation.BottomRight; 24 | public override float EffectDuration => 0f; 25 | public override LoadableAsset Sprite => MiraAssets.Empty; 26 | 27 | private NetworkedPlayerInfo targetPlayer; 28 | 29 | public override bool Enabled(RoleBehaviour role) 30 | { 31 | return role is SpecialAgent; 32 | } 33 | public override bool CanUse() 34 | { 35 | return SpecialAgent.AssignedPlayer == null; 36 | } 37 | protected override void OnClick() 38 | { 39 | ShapeshifterRole shapeshifterRole = Object.Instantiate( 40 | RoleManager.Instance.AllRoles.First(r => r.Role == RoleTypes.Shapeshifter) 41 | ).TryCast(); 42 | 43 | ShapeshifterMinigame minigame = Object.Instantiate(shapeshifterRole.ShapeshifterMenu); 44 | Object.Destroy(shapeshifterRole.gameObject); 45 | minigame.name = "SpecialAgent Mission"; 46 | minigame.transform.SetParent(Camera.main.transform, false); 47 | minigame.transform.localPosition = new Vector3(0f, 0f, -50f); 48 | Minigame.Instance = minigame; 49 | minigame.MyTask = null; 50 | minigame.MyNormTask = null; 51 | 52 | if (PlayerControl.LocalPlayer) 53 | { 54 | if (MapBehaviour.Instance) 55 | { 56 | MapBehaviour.Instance.Close(); 57 | } 58 | PlayerControl.LocalPlayer.MyPhysics.SetNormalizedVelocity(Vector2.zero); 59 | } 60 | 61 | minigame.StartCoroutine(minigame.CoAnimateOpen()); 62 | DestroyableSingleton.Instance.Analytics.MinigameOpened(PlayerControl.LocalPlayer.Data, minigame.TaskType); 63 | minigame.potentialVictims = new Il2CppSystem.Collections.Generic.List(); 64 | 65 | List playerList = PlayerControl.AllPlayerControls.ToArray() 66 | .Where(p => !p.Data.IsDead && !p.Data.Disconnected && p.PlayerId != PlayerControl.LocalPlayer.PlayerId) 67 | .ToList(); 68 | 69 | Il2CppSystem.Collections.Generic.List uiElements = new(); 70 | 71 | for (int i = 0; i < playerList.Count; i++) 72 | { 73 | var player = playerList[i]; 74 | int num = i % 3; 75 | int num2 = i / 3; 76 | bool flag = PlayerControl.LocalPlayer.Data.Role.NameColor == player.Data.Role.NameColor; 77 | 78 | ShapeshifterPanel panel = Object.Instantiate(minigame.PanelPrefab, minigame.transform); 79 | panel.transform.localPosition = new Vector3( 80 | minigame.XStart + num * minigame.XOffset, 81 | minigame.YStart + num2 * minigame.YOffset, 82 | -1f 83 | ); 84 | 85 | NetworkedPlayerInfo playerInfo = player.Data; 86 | 87 | panel.SetPlayer(i, playerInfo, (Il2CppSystem.Action)(() => 88 | { 89 | SpecialAgent.AssignedPlayer = playerInfo.Object; 90 | 91 | Utils.AssignMission(SpecialAgent.AssignedPlayer); 92 | 93 | if (OptionGroupSingleton.Instance.TargetCameraTracking) 94 | { 95 | var cam = Camera.main.GetComponent(); 96 | if (cam != null) 97 | { 98 | cam.SetTarget(targetPlayer.Object); 99 | Coroutines.Start(CoResetCamera(cam, OptionGroupSingleton.Instance.CameraTrackingDuration)); 100 | } 101 | } 102 | minigame.Close(); 103 | })); 104 | 105 | panel.NameText.color = flag ? player.Data.Role.NameColor : Color.white; 106 | minigame.potentialVictims.Add(panel); 107 | uiElements.Add(panel.Button); 108 | } 109 | 110 | ControllerManager.Instance.OpenOverlayMenu( 111 | minigame.name, 112 | minigame.BackButton, 113 | minigame.DefaultButtonSelected, 114 | uiElements 115 | ); 116 | } 117 | public static IEnumerator CoResetCamera(FollowerCamera cam, float duration) 118 | { 119 | float timeElapsed = 0f; 120 | 121 | while (timeElapsed < duration) 122 | { 123 | timeElapsed += Time.deltaTime; 124 | yield return null; 125 | } 126 | 127 | if (cam != null) 128 | { 129 | cam.SetTarget(PlayerControl.LocalPlayer); 130 | } 131 | } 132 | } 133 | } 134 | -------------------------------------------------------------------------------- /NewMod/Buttons/CaptureButton.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using MiraAPI.Utilities.Assets; 3 | using MiraAPI.Hud; 4 | using MiraAPI.GameOptions; 5 | using NewMod.Options.Roles.VisionaryOptions; 6 | using NewMod.Roles.CrewmateRoles; 7 | using UnityEngine; 8 | using Reactor.Utilities; 9 | using NewMod.Utilities; 10 | 11 | namespace NewMod.Buttons 12 | { 13 | [RegisterButton] 14 | public class CaptureButton : CustomActionButton 15 | { 16 | public override string Name => "Capture"; 17 | public override float Cooldown => OptionGroupSingleton.Instance.ScreenshotCooldown; 18 | public override float EffectDuration => 0; 19 | public override int MaxUses => (int)OptionGroupSingleton.Instance.MaxScreenshots; 20 | public override LoadableAsset Sprite => NewModAsset.Camera; 21 | public override ButtonLocation Location => ButtonLocation.BottomLeft; 22 | protected override void OnClick() 23 | { 24 | var timestamp = System.DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm-ss"); 25 | string path = Path.Combine(VisionaryUtilities.ScreenshotDirectory, $"screenshot_{timestamp}.png"); 26 | Coroutines.Start(Utils.CaptureScreenshot(path)); 27 | } 28 | public override bool Enabled(RoleBehaviour role) 29 | { 30 | return role is TheVisionary; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /NewMod/Buttons/DrainButton.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.GameOptions; 2 | using MiraAPI.Hud; 3 | using MiraAPI.Utilities; 4 | using MiraAPI.Utilities.Assets; 5 | using NewMod.Options.Roles.EnergyThiefOptions; 6 | using NewMod.Roles.NeutralRoles; 7 | using UnityEngine; 8 | using NewMod.Utilities; 9 | 10 | namespace NewMod.Buttons; 11 | 12 | [RegisterButton] 13 | public class DrainButton : CustomActionButton 14 | { 15 | public override string Name => "DRAIN"; 16 | public override float Cooldown => OptionGroupSingleton.Instance.DrainCooldown; 17 | public override int MaxUses => (int)OptionGroupSingleton.Instance.DrainMaxUses; 18 | public override ButtonLocation Location => ButtonLocation.BottomRight; 19 | public override float EffectDuration => 0f; 20 | public override LoadableAsset Sprite => MiraAssets.Empty; 21 | public override PlayerControl GetTarget() 22 | { 23 | return PlayerControl.LocalPlayer.GetClosestPlayer(true, Distance, false, p => !p.Data.IsDead && !p.Data.Disconnected); 24 | } 25 | public override void SetOutline(bool active) 26 | { 27 | Target?.cosmetics.SetOutline(active, new Il2CppSystem.Nullable(Color.magenta)); 28 | } 29 | public override bool IsTargetValid(PlayerControl? target) 30 | { 31 | return true; 32 | } 33 | public override bool Enabled(RoleBehaviour role) 34 | { 35 | return role is EnergyThief; 36 | } 37 | protected override void OnClick() 38 | { 39 | PendingEffectManager.AddPendingEffect(Target); 40 | 41 | Utils.RecordDrainCount(PlayerControl.LocalPlayer); 42 | 43 | if (PlayerControl.LocalPlayer.AmOwner) 44 | { 45 | HudManager.Instance.Notifier.AddDisconnectMessage($"The Drain effect will be applied to {Target.Data.PlayerName} after the meeting ends."); 46 | } 47 | Utils.waitingPlayers.Add(PlayerControl.LocalPlayer); 48 | } 49 | 50 | public override bool CanUse() 51 | { 52 | if (Utils.waitingPlayers.Contains(PlayerControl.LocalPlayer)) 53 | { 54 | return false; 55 | } 56 | return base.CanUse(); 57 | } 58 | } 59 | 60 | -------------------------------------------------------------------------------- /NewMod/Buttons/FakeBodyButton.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.GameOptions; 2 | using MiraAPI.Hud; 3 | using MiraAPI.Utilities; 4 | using MiraAPI.Utilities.Assets; 5 | using NewMod.Options.Roles.PranksterOptions; 6 | using NewMod.Roles.NeutralRoles; 7 | using UnityEngine; 8 | using NewMod.Utilities; 9 | 10 | namespace NewMod.Buttons 11 | { 12 | [RegisterButton] 13 | public class FakeBodyButton : CustomActionButton 14 | { 15 | public override string Name => "Prank"; 16 | public override float Cooldown => OptionGroupSingleton.Instance.PrankCooldown; 17 | public override int MaxUses => (int)OptionGroupSingleton.Instance.PrankMaxUses; 18 | public override ButtonLocation Location => ButtonLocation.BottomRight; 19 | public override float EffectDuration => 0f; 20 | public override LoadableAsset Sprite => NewModAsset.DeadBodySprite; 21 | protected override void OnClick() 22 | { 23 | PranksterUtilities.CreatePranksterDeadBody(PlayerControl.LocalPlayer, PlayerControl.LocalPlayer.PlayerId); 24 | } 25 | public override bool Enabled(RoleBehaviour role) 26 | { 27 | return role is Prankster; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /NewMod/Buttons/NecromancerButton.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.GameOptions; 2 | using MiraAPI.Hud; 3 | using MiraAPI.Utilities.Assets; 4 | using NewMod.Options.Roles.NecromancerOptions; 5 | using NewMod.Roles.ImpostorRoles; 6 | using UnityEngine; 7 | using NewMod.Utilities; 8 | 9 | namespace NewMod.Buttons; 10 | 11 | [RegisterButton] 12 | public class NecromancerButton : CustomActionButton 13 | { 14 | public override string Name => ""; // It's currently empty since the button has already a name on it 15 | public override float Cooldown => OptionGroupSingleton.Instance.ButtonCooldown; 16 | public override int MaxUses => (int)OptionGroupSingleton.Instance.AbilityUses; 17 | public override float EffectDuration => 0f; 18 | public override ButtonLocation Location => ButtonLocation.BottomLeft; 19 | public override LoadableAsset Sprite => NewModAsset.NecromancerButton; 20 | protected override void OnClick() 21 | { 22 | NewMod.Instance.Log.LogMessage("Button Clicked!"); 23 | 24 | var closestBody = Utils.GetClosestBody(); 25 | if (closestBody != null) 26 | { 27 | Utils.RpcRevive(closestBody); 28 | } 29 | } 30 | public override bool Enabled(RoleBehaviour role) 31 | { 32 | return role is NecromancerRole; 33 | } 34 | public override bool CanUse() 35 | { 36 | bool isTimerDone = Timer <= 0; 37 | bool hasUsesLeft = UsesLeft > 0; 38 | var closestBody = Utils.GetClosestBody(); 39 | bool isNearDeadBody = closestBody != null; 40 | bool isFakeBody = isNearDeadBody && PranksterUtilities.IsPranksterBody(closestBody); 41 | 42 | if (closestBody == null) 43 | { 44 | return false; 45 | } 46 | 47 | bool wasNotKilledByNecromancer = true; 48 | var deadBody = closestBody.GetComponent(); 49 | if (deadBody != null) 50 | { 51 | var killedPlayer = GameData.Instance.GetPlayerById(deadBody.ParentId)?.Object; 52 | if (killedPlayer != null) 53 | { 54 | var killer = Utils.GetKiller(killedPlayer); 55 | if (killer != null && killer.Data.Role is NecromancerRole) 56 | { 57 | wasNotKilledByNecromancer = false; 58 | } 59 | } 60 | } 61 | return isTimerDone && hasUsesLeft && isNearDeadBody && wasNotKilledByNecromancer && !isFakeBody; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /NewMod/Buttons/ShowScreenshotButton.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.Utilities.Assets; 2 | using MiraAPI.Hud; 3 | using MiraAPI.GameOptions; 4 | using NewMod.Options.Roles.VisionaryOptions; 5 | using NewMod.Roles.CrewmateRoles; 6 | using UnityEngine; 7 | using NewMod.Utilities; 8 | using Reactor.Utilities; 9 | using System.Linq; 10 | 11 | namespace NewMod.Buttons 12 | { 13 | [RegisterButton] 14 | public class ShowScreenshotButton : CustomActionButton 15 | { 16 | public override string Name => "ShowScreenshot"; 17 | public override float Cooldown => OptionGroupSingleton.Instance.ScreenshotCooldown; 18 | public override float EffectDuration => 0; 19 | public override int MaxUses => (int)OptionGroupSingleton.Instance.MaxScreenshots; 20 | public override LoadableAsset Sprite => MiraAssets.Empty; 21 | public override ButtonLocation Location => ButtonLocation.BottomRight; 22 | public override bool CanUse() 23 | { 24 | return base.CanUse() && VisionaryUtilities.CapturedScreenshotPaths.Any(); 25 | } 26 | protected override void OnClick() 27 | { 28 | Coroutines.Start(VisionaryUtilities.ShowScreenshots(OptionGroupSingleton.Instance.MaxDisplayDuration)); 29 | } 30 | public override bool Enabled(RoleBehaviour role) 31 | { 32 | return role is TheVisionary; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /NewMod/CustomColor/NewModColor.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.Colors; 2 | using UnityEngine; 3 | 4 | namespace NewMod.Colors 5 | { 6 | [RegisterCustomColors] 7 | public static class NewModColors 8 | { 9 | // NewMod v1.0.0 10 | public static CustomColor OceanColor {get;} = new CustomColor("OceaBlue", new Color32(0, 105, 148, 255), new Color32(0, 73, 103, 255)); 11 | public static CustomColor Gold {get;} = new CustomColor("Gold", new Color(1.0f, 0.84f, 0.0f)); // Thanks to : https://github.com/All-Of-Us-Mods/MiraAPI/blob/master/MiraAPI.Example/ExampleColors.cs#L13 12 | public static CustomColor BloodRed { get; } = new CustomColor("BloodRed", new Color32(138, 3, 3, 255), new Color32(104, 2, 2, 255)); 13 | public static CustomColor CrimsonTide { get; } = new CustomColor("CrimsonTide", new Color32(220, 20, 60, 255), new Color32(176, 16, 48, 255)); 14 | public static CustomColor MidnightBlue {get;} = new CustomColor("MidNight",new Color32(25, 25, 112, 255), new Color32(15, 15, 80, 255)); 15 | public static CustomColor NeonGreen {get;} = new CustomColor("NeonGreen", new Color32(57, 255, 20, 255), new Color32(34, 139, 34, 255)); 16 | public static CustomColor ElectricPurple {get;} = new CustomColor("ElectricPurple", new Color32(191, 0, 255, 255), new Color32(128, 0, 170, 255)); 17 | public static CustomColor PastelPink {get;} = new CustomColor("PastelPink", new Color32(255, 182, 193, 255), new Color32(255, 105, 180, 255)); 18 | public static CustomColor JadeGreen { get; } = new CustomColor("JadeGreen", new Color32(0, 168, 107, 255), new Color32(0, 134, 85, 255)); 19 | public static CustomColor CobaltBlue { get; } = new CustomColor("CobaltBlue", new Color32(0, 71, 171, 255), new Color32(0, 57, 137, 255)); 20 | public static CustomColor BurntSienna { get; } = new CustomColor("BurntSienna", new Color32(233, 116, 81, 255), new Color32(187, 93, 65, 255)); 21 | public static CustomColor TropicalYellow { get; } = new CustomColor("TropicalYellow", new Color32(255, 255, 102, 255), new Color32(230, 230, 90, 255)); 22 | public static CustomColor VelvetMaroon { get; } = new CustomColor("VelvetMaroon", new Color32(128, 0, 0, 255), new Color32(105, 0, 0, 255)); 23 | public static CustomColor DesertRose { get; } = new CustomColor("DesertRose", new Color32(201, 76, 76, 255), new Color32(175, 60, 60, 255)); 24 | public static CustomColor AtomicTangerine { get; } = new CustomColor("AtomicTangerine", new Color32(255, 153, 102, 255), new Color32(230, 140, 95, 255)); 25 | public static CustomColor Olive {get;} = new CustomColor("Olive", new Color32(128, 128, 0, 255)); 26 | 27 | // NewMod v1.1.0 28 | public static CustomColor SkyBlue { get; } = new CustomColor("SkyBlue", new Color32(135, 206, 235, 255), new Color32(70, 130, 180, 255)); 29 | public static CustomColor Salmon { get; } = new CustomColor("Salmon", new Color32(250, 128, 114, 255), new Color32(233, 150, 122, 255)); 30 | public static CustomColor Teal { get; } = new CustomColor("Teal", new Color32(0, 128, 128, 255), new Color32(0, 100, 100, 255)); 31 | public static CustomColor Amber { get; } = new CustomColor("Amber", new Color32(255, 191, 0, 255), new Color32(255, 165, 0, 255)); 32 | public static CustomColor Turquoise { get; } = new CustomColor("Turquoise", new Color32(64, 224, 208, 255), new Color32(72, 209, 204, 255)); 33 | public static CustomColor SlateGray { get; } = new CustomColor("SlateGray", new Color32(112, 128, 144, 255), new Color32(47, 79, 79, 255)); 34 | public static CustomColor Periwinkle { get; } = new CustomColor("Periwinkle", new Color32(204, 204, 255, 255), new Color32(196, 196, 255, 255)); 35 | public static CustomColor LimeGreen { get; } = new CustomColor("LimeGreen", new Color32(50, 205, 50, 255), new Color32(34, 139, 34, 255)); 36 | public static CustomColor Indigo { get; } = new CustomColor("Indigo", new Color32(75, 0, 130, 255), new Color32(54, 0, 102, 255)); 37 | public static CustomColor Apricot { get; } = new CustomColor("Apricot", new Color32(251, 206, 177, 255), new Color32(255, 160, 122, 255)); 38 | public static CustomColor Charcoal { get; } = new CustomColor("Charcoal", new Color32(54, 69, 79, 255), new Color32(70, 70, 70, 255)); 39 | public static CustomColor Burgundy { get; } = new CustomColor("Burgundy", new Color32(128, 0, 32, 255), new Color32(100, 0, 20, 255)); 40 | public static CustomColor Mustard { get; } = new CustomColor("Mustard", new Color32(255, 219, 88, 255), new Color32(255, 215, 0, 255)); 41 | public static CustomColor Emerald { get; } = new CustomColor("Emerald", new Color32(80, 200, 120, 255), new Color32(0, 201, 87, 255)); 42 | public static CustomColor Fuchsia { get; } = new CustomColor("Fuchsia", new Color32(255, 119, 255, 255), new Color32(255, 0, 255, 255)); 43 | public static CustomColor NavyBlue { get; } = new CustomColor("NavyBlue", new Color32(0, 0, 128, 255), new Color32(0, 0, 102, 255)); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /NewMod/CustomGameModes/RevivalRoyale.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using AmongUs.GameOptions; 4 | using MiraAPI.GameModes; 5 | using MiraAPI.Hud; 6 | using MiraAPI.Roles; 7 | using MiraAPI.Utilities; 8 | using NewMod.Buttons; 9 | using NewMod.Roles.ImpostorRoles; 10 | using TMPro; 11 | 12 | namespace NewMod.CustomGameModes 13 | { 14 | [RegisterGameMode] 15 | public class RevivalRoyale : CustomGameMode 16 | { 17 | public TextMeshPro ReviveCounter; 18 | public Dictionary playerReviveCounts = new Dictionary(); 19 | public int ReviveCount = 0; 20 | private Dictionary playerStates = new Dictionary(); 21 | public override string Name => "Revival Royale"; 22 | public override string Description => "Everyone is a Necromancer. Revive as many bodies as you can to outlast your opponents.\nThe one with the most revivals wins the Revival Royale"; 23 | public override int Id => 1; 24 | 25 | public override void Initialize() 26 | { 27 | foreach (var player in PlayerControl.AllPlayerControls) 28 | { 29 | player.RpcSetRole((RoleTypes)RoleId.Get()); 30 | playerReviveCounts[player] = ReviveCount; 31 | playerStates[player] = player.Data.IsDead; 32 | CustomButtonSingleton.Instance.IncreaseUses(3); 33 | NewMod.Instance.Log.LogMessage("Initialize RevivalRoyale GameMode done!"); 34 | } 35 | } 36 | 37 | public override void HudUpdate(HudManager instance) 38 | { 39 | foreach (var player in PlayerControl.AllPlayerControls) 40 | { 41 | bool isDead = player.Data.IsDead; 42 | 43 | if (playerStates.ContainsKey(player) && playerStates[player] && !isDead) 44 | { 45 | if (playerReviveCounts.ContainsKey(PlayerControl.LocalPlayer)) 46 | { 47 | playerReviveCounts[PlayerControl.LocalPlayer]++; 48 | ReviveCount = playerReviveCounts[PlayerControl.LocalPlayer]; 49 | } 50 | ReviveCounter.text = $"Revive Count: {ReviveCount}"; 51 | if (ReviveCount >= 6) 52 | { 53 | GameManager.Instance.RpcEndGame(GameOverReason.ImpostorByKill, true); 54 | break; 55 | } 56 | } 57 | playerStates[player] = isDead; 58 | } 59 | } 60 | 61 | public override void HudStart(HudManager instance) 62 | { 63 | ReviveCounter = Helpers.CreateTextLabel("RR", instance.transform, AspectPosition.EdgeAlignments.Top, new UnityEngine.Vector3(0f, 0.20f, 0f), 2f, TextAlignmentOptions.MidlineRight); 64 | int localReviveCount = playerReviveCounts.ContainsKey(PlayerControl.LocalPlayer) ? playerReviveCounts[PlayerControl.LocalPlayer] : 0; 65 | ReviveCounter.text = $"Revive Count: {localReviveCount}"; 66 | } 67 | 68 | public override List CalculateWinners() 69 | { 70 | var winner = playerReviveCounts.OrderByDescending(kvp => kvp.Value).FirstOrDefault(); 71 | return winner.Key != null ? new List { winner.Key.Data } : new List(); 72 | } 73 | 74 | public override void CheckGameEnd(out bool runOriginal, LogicGameFlowNormal instance) 75 | { 76 | runOriginal = false; 77 | } 78 | public override bool AreGameSettingsEnabled() 79 | { 80 | return false; 81 | } 82 | public override bool CanReport(DeadBody body) 83 | { 84 | return false; 85 | } 86 | public override bool ShouldShowSabotageMap(MapBehaviour map) 87 | { 88 | return false; 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /NewMod/CustomRPC.cs: -------------------------------------------------------------------------------- 1 | namespace NewMod; 2 | public enum CustomRPC 3 | { 4 | Revive, 5 | Drain, 6 | FakeBody, 7 | AssignMission 8 | } -------------------------------------------------------------------------------- /NewMod/DebugWindow.cs: -------------------------------------------------------------------------------- 1 | using AmongUs.GameOptions; 2 | using Il2CppInterop.Runtime.Attributes; 3 | using MiraAPI.Hud; 4 | using MiraAPI.Roles; 5 | using MiraAPI.Utilities; 6 | using NewMod.Buttons; 7 | using NewMod.Modifiers; 8 | using NewMod.Roles.CrewmateRoles; 9 | using NewMod.Roles.ImpostorRoles; 10 | using NewMod.Roles.NeutralRoles; 11 | using Reactor.Utilities.Attributes; 12 | using Reactor.Utilities.ImGui; 13 | using UnityEngine; 14 | 15 | namespace NewMod; 16 | 17 | [RegisterInIl2Cpp] 18 | public class DebugWindow(nint ptr) : MonoBehaviour(ptr) 19 | { 20 | [HideFromIl2Cpp] 21 | public bool EnableDebugger {get; set;} = false; 22 | public readonly DragWindow DebuggingWindow = new(new Rect(10, 10, 0, 0), "NewMod Debug Window", () => 23 | { 24 | bool isFreeplay = AmongUsClient.Instance.NetworkMode == NetworkModes.FreePlay; 25 | 26 | if (GUILayout.Button("Become Explosive Modifier")) 27 | { 28 | if (!isFreeplay) return; 29 | PlayerControl.LocalPlayer.RpcAddModifier(); 30 | } 31 | if (GUILayout.Button("Remove Explosive Modifier")) 32 | { 33 | if (!isFreeplay) return; 34 | PlayerControl.LocalPlayer.RpcRemoveModifier(); 35 | } 36 | if (GUILayout.Button("Disable Collider")) 37 | { 38 | if (!isFreeplay) return; 39 | PlayerControl.LocalPlayer.Collider.enabled = false; 40 | } 41 | if (GUILayout.Button("Enable Collider")) 42 | { 43 | if (!isFreeplay) return; 44 | PlayerControl.LocalPlayer.Collider.enabled = true; 45 | } 46 | if (GUILayout.Button("Become Necromancer")) 47 | { 48 | if (!isFreeplay) return; 49 | PlayerControl.LocalPlayer.RpcSetRole((RoleTypes)RoleId.Get(), false); 50 | } 51 | if (GUILayout.Button("Become DoubleAgent")) 52 | { 53 | if (!isFreeplay) return; 54 | PlayerControl.LocalPlayer.RpcSetRole((RoleTypes)RoleId.Get(), false); 55 | } 56 | if (GUILayout.Button("Become EnergyThief")) 57 | { 58 | if (!isFreeplay) return; 59 | PlayerControl.LocalPlayer.RpcSetRole((RoleTypes)RoleId.Get(), false); 60 | } 61 | if (GUILayout.Button("Become SpecialAgent")) 62 | { 63 | if (!isFreeplay) return; 64 | PlayerControl.LocalPlayer.RpcSetRole((RoleTypes)RoleId.Get(), false); 65 | } 66 | if (GUILayout.Button("Force Start Game")) 67 | { 68 | if (GameOptionsManager.Instance.CurrentGameOptions.NumImpostors is 1) return; 69 | AmongUsClient.Instance.StartGame(); 70 | } 71 | if (GUILayout.Button("Increases Uses by 3")) 72 | { 73 | var player = PlayerControl.LocalPlayer; 74 | if (player.Data.Role is NecromancerRole) 75 | { 76 | CustomButtonSingleton.Instance.IncreaseUses(3); 77 | } 78 | else if (player.Data.Role is EnergyThief) 79 | { 80 | CustomButtonSingleton.Instance.IncreaseUses(3); 81 | } 82 | else if (player.Data.Role is SpecialAgent) 83 | { 84 | CustomButtonSingleton.Instance.IncreaseUses(3); 85 | } 86 | else if (player.Data.Role is Prankster) 87 | { 88 | CustomButtonSingleton.Instance.IncreaseUses(3); 89 | } 90 | else 91 | { 92 | CustomButtonSingleton.Instance.IncreaseUses(3); 93 | CustomButtonSingleton.Instance.IncreaseUses(3); 94 | } 95 | } 96 | }); 97 | 98 | public void OnGUI() 99 | { 100 | if (EnableDebugger) DebuggingWindow.OnGUI(); 101 | } 102 | public void Update() 103 | { 104 | if (Input.GetKey(KeyCode.F3)) 105 | EnableDebugger = !EnableDebugger; 106 | } 107 | } -------------------------------------------------------------------------------- /NewMod/DiscordStatus.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using Discord; 3 | using MiraAPI; 4 | using UnityEngine; 5 | 6 | namespace NewMod 7 | { 8 | [HarmonyPatch(typeof(ActivityManager), nameof(ActivityManager.UpdateActivity))] 9 | public static class DiscordPlayStatusPatch 10 | { 11 | public static void Prefix([HarmonyArgument(0)] Activity activity) 12 | { 13 | if (activity == null) return; 14 | 15 | var isBeta = false; 16 | 17 | string details = $"New Mod v{NewMod.ModVersion}" + (isBeta ? " (Beta)" : "(dev)"); 18 | 19 | activity.Details = details; 20 | 21 | try 22 | { 23 | if (activity.State == "In Menus") 24 | { 25 | int maxPlayers = GameOptionsManager.Instance.currentNormalGameOptions.MaxPlayers; 26 | var lobbyCode = GameStartManager.Instance.GameRoomNameCode.text; 27 | var miraAPIVersion = MiraApiPlugin.Version; 28 | var platform = Application.platform; 29 | 30 | details += $" Players: {maxPlayers} | Lobby Code: {lobbyCode} | MiraAPI Version {miraAPIVersion} | Platform: {platform}"; 31 | } 32 | 33 | else if (activity.State == "In Game") 34 | { 35 | if (MeetingHud.Instance) 36 | { 37 | details += " | \nIn Meeting"; 38 | } 39 | } 40 | 41 | activity.Assets.SmallText = "NewMod Made With MiraAPI"; 42 | } 43 | catch (System.Exception e) 44 | { 45 | NewMod.Instance.Log.LogError($"Error updating Discord activity: {e.Message}\nStackTrace: {e.StackTrace}"); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /NewMod/MissionType.cs: -------------------------------------------------------------------------------- 1 | namespace NewMod 2 | { 3 | /// 4 | /// Represents the different types of missions available to players. 5 | /// 6 | public enum MissionType 7 | { 8 | /// 9 | /// Mission to kill the most wanted target. 10 | /// 11 | KillMostWanted, 12 | 13 | /// 14 | /// Mission to drain a player's energy using Energy Thief abilities. 15 | /// 16 | DrainEnergy, 17 | 18 | /// 19 | /// Mission to disguise as a random player and create fake dead bodies using Prankster abilities. 20 | /// 21 | CreateFakeBodies, 22 | 23 | /// 24 | /// Mission to revive a dead player using Necromancer powers and kill them again. 25 | /// 26 | ReviveAndKill 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /NewMod/Modifiers/ExplosiveModifier.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.GameOptions; 2 | using MiraAPI.Modifiers; 3 | using MiraAPI.Modifiers.Types; 4 | using MiraAPI.Utilities; 5 | using NewMod.Utilities; 6 | using NewMod.Options; 7 | using MiraAPI.Networking; 8 | using UnityEngine; 9 | 10 | namespace NewMod.Modifiers; 11 | 12 | [RegisterModifier] 13 | public class ExplosiveModifier : TimedModifier 14 | { 15 | public override string ModifierName => "Explosive"; 16 | public override bool HideOnUi => false; 17 | public override bool AutoStart => true; 18 | public override float Duration => OptionGroupSingleton.Instance.Duration; 19 | public override bool RemoveOnComplete => true; 20 | private bool isFlashing = false; 21 | public override bool CanVent() 22 | { 23 | return Player.Data.Role.CanVent; 24 | } 25 | public override string GetHudString() 26 | { 27 | return ModifierName + "\nif you die, all nearby players are killed"; 28 | } 29 | public override void OnActivate() 30 | { 31 | NewMod.Instance.Log.LogInfo("Activated!"); 32 | } 33 | public override void OnDeactivate() 34 | { 35 | NewMod.Instance.Log.LogInfo("Deactivated!"); 36 | } 37 | public override void FixedUpdate() 38 | { 39 | base.FixedUpdate(); 40 | 41 | if (Player.AmOwner) 42 | { 43 | if (Duration <= 5f) 44 | { 45 | isFlashing = !isFlashing; 46 | var color = isFlashing ? new Color(1f, 0f, 0f) : new Color(0.5f, 0.5f, 0.5f); 47 | Player.cosmetics.currentBodySprite.BodySprite.material.SetColor(ShaderID.VisorColor, color); 48 | } 49 | else if (Duration <= 10f) 50 | { 51 | Player.cosmetics.currentBodySprite.BodySprite.material.SetColor(ShaderID.VisorColor, new Color(0f, 0.8f, 1f)); 52 | } 53 | else if (Duration <= 30f) 54 | { 55 | Player.cosmetics.currentBodySprite.BodySprite.material.SetColor(ShaderID.VisorColor, new Color(0f, 1.5f, 0f)); 56 | } 57 | } 58 | } 59 | public override void OnTimerComplete() 60 | { 61 | 62 | } 63 | public override void OnDeath(DeathReason deathReason) 64 | { 65 | var murderer = Utils.GetKiller(Player); 66 | if (murderer == null) return; 67 | 68 | var closestPlayers = Helpers.GetClosestPlayers(Player.GetTruePosition(), OptionGroupSingleton.Instance.KillDistance, true); 69 | 70 | foreach (var player in closestPlayers) 71 | { 72 | if (player.Data.IsDead || player.Data.Disconnected) continue; 73 | 74 | murderer.RpcCustomMurder( 75 | player, 76 | createDeadBody: true, 77 | didSucceed: true, 78 | showKillAnim: false, 79 | playKillSound: true, 80 | teleportMurderer: false 81 | ); 82 | NewMod.Instance.Log.LogInfo($"{player.Data.PlayerName} has been killed by the explosion."); 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /NewMod/NewMod.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using System.IO; 3 | using UnityEngine; 4 | using Object = UnityEngine.Object; 5 | using BepInEx; 6 | using BepInEx.Unity.IL2CPP; 7 | using BepInEx.Configuration; 8 | using MiraAPI; 9 | using MiraAPI.Networking; 10 | using MiraAPI.GameOptions; 11 | using MiraAPI.PluginLoading; 12 | using MiraAPI.Utilities; 13 | using Reactor; 14 | using Reactor.Networking.Attributes; 15 | using Reactor.Utilities; 16 | using HarmonyLib; 17 | using NewMod.Options; 18 | using NewMod.Utilities; 19 | using NewMod.Roles.ImpostorRoles; 20 | using Sentry.Unity; 21 | 22 | namespace NewMod; 23 | 24 | [BepInPlugin(Id, "NewMod", ModVersion)] 25 | [BepInDependency(ReactorPlugin.Id)] 26 | [BepInDependency(MiraApiPlugin.Id)] 27 | [ReactorModFlags(Reactor.Networking.ModFlags.RequireOnAllClients)] 28 | [BepInProcess("Among Us.exe")] 29 | public partial class NewMod : BasePlugin, IMiraPlugin 30 | { 31 | public const string Id = "com.callofcreator.newmod"; 32 | public const string ModVersion = "1.1.0"; 33 | public Harmony Harmony { get; } = new Harmony(Id); 34 | public static BasePlugin Instance; 35 | public static Minigame minigame; 36 | public const string SupportedAmongUsVersion = "2024.11.26"; 37 | public static ConfigEntry ShouldEnableBepInExConsole {get; set;} 38 | public ConfigFile GetConfigFile() => Config; 39 | public string OptionsTitleText => "NewMod"; 40 | public override void Load() 41 | { 42 | Instance = this; 43 | AddComponent(); 44 | ReactorCredits.Register(ReactorCredits.AlwaysShow); 45 | Harmony.PatchAll(); 46 | CheckVersionCompatibility(); 47 | ShouldEnableBepInExConsole = Config.Bind("NewMod", "Console", false, "Whether to enable BepInEx Console for debugging"); 48 | Instance.Log.LogMessage($"Loaded Successfully NewMod v{ModVersion} With MiraAPI Version : {MiraApiPlugin.Version} with ID : {MiraApiPlugin.Id}"); 49 | if (!ShouldEnableBepInExConsole.Value) ConsoleManager.DetachConsole(); 50 | } 51 | public static void CheckVersionCompatibility() 52 | { 53 | if (Application.version != SupportedAmongUsVersion) 54 | { 55 | Instance.Log.LogError($"Detected unsupported Among Us version. Current version: {Application.version}, Supported version: {SupportedAmongUsVersion}"); 56 | } 57 | } 58 | 59 | [HarmonyPatch(typeof(KeyboardJoystick), nameof(KeyboardJoystick.Update))] 60 | public class KeyboardJoystickUpdatePatch 61 | { 62 | public static void Postfix(KeyboardJoystick __instance) 63 | { 64 | InitializeKeyBinds(); 65 | } 66 | } 67 | public static void InitializeKeyBinds() 68 | { 69 | if (AmongUsClient.Instance.GameState != InnerNet.InnerNetClient.GameStates.Started) return; 70 | 71 | if (Input.GetKeyDown(KeyCode.F2) && PlayerControl.LocalPlayer.Data.Role.Role is AmongUs.GameOptions.RoleTypes.Crewmate && OptionGroupSingleton.Instance.CanOpenCams) 72 | { 73 | var cam = Object.FindObjectsOfType().FirstOrDefault(x => x.name.Contains("Surv")); 74 | if (Camera.main is not null || cam != null) 75 | { 76 | minigame = Object.Instantiate(cam.MinigamePrefab, Camera.main.transform, false); 77 | minigame.transform.localPosition = new Vector3(0f, 0f, -50f); 78 | minigame.Begin(null); 79 | } 80 | } 81 | if (Input.GetKeyDown(KeyCode.F4) && PlayerControl.LocalPlayer.Data.Role is NecromancerRole && OptionGroupSingleton.Instance.EnableTeleportation) 82 | { 83 | var deadBodies = Helpers.GetNearestDeadBodies(PlayerControl.LocalPlayer.GetTruePosition(), 20f, Helpers.CreateFilter(Constants.NotShipMask)); 84 | if (deadBodies != null && deadBodies.Count > 0) 85 | { 86 | var randomIndex = Random.Range(0, deadBodies.Count); 87 | var randomBodyPosition = deadBodies[randomIndex].transform.position; 88 | PlayerControl.LocalPlayer.NetTransform.RpcSnapTo(randomBodyPosition); 89 | } 90 | else 91 | { 92 | CoroutinesHelper.CoNotify("No dead bodies nearby to teleport to."); 93 | } 94 | } 95 | } 96 | 97 | [HarmonyPatch(typeof(CustomMurderRpc), nameof(CustomMurderRpc.RpcCustomMurder))] 98 | public static class CustomMurderPatch 99 | { 100 | public static void Postfix(PlayerControl target, bool didSucceed, bool resetKillTimer, bool createDeadBody, bool teleportMurderer, bool showKillAnim, bool playKillSound) 101 | { 102 | Utils.RecordOnKill(PlayerControl.LocalPlayer, target); 103 | } 104 | } 105 | 106 | [HarmonyPatch(typeof(TaskPanelBehaviour), nameof(TaskPanelBehaviour.SetTaskText))] 107 | public static class SetTaskTextPatch 108 | { 109 | public static void Postfix(TaskPanelBehaviour __instance, [HarmonyArgument(0)] string str) 110 | { 111 | if (AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GameStates.Started && PlayerControl.LocalPlayer.Data.Role.Role is AmongUs.GameOptions.RoleTypes.Crewmate) 112 | { 113 | __instance.taskText.text += "\n" + (OptionGroupSingleton.Instance.CanOpenCams ? "Press F2 For Open Cams" : "You cannot open cams because the host has disabled this setting"); 114 | } 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /NewMod/NewMod.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1.1.0 4 | dev 5 | Among Us Mod 6 | CallofCreator 7 | net6.0 8 | latest 9 | embedded 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NewMod/NewModAsset.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.Utilities.Assets; 2 | 3 | namespace NewMod; 4 | 5 | public static class NewModAsset 6 | { 7 | public static LoadableResourceAsset Banner { get; } = new("NewMod.Resources.optionImage.png"); 8 | public static LoadableResourceAsset DeadBodySprite { get; } = new("NewMod.Resources.deadbody.png"); 9 | public static LoadableResourceAsset NecromancerButton { get; } = new("NewMod.Resources.Revive2.png"); 10 | public static LoadableResourceAsset Arrow { get; } = new("NewMod.Resources.Arrow.png"); 11 | public static LoadableResourceAsset ModLogo { get; } = new("NewMod.Resources.Logo.png"); 12 | public static LoadableResourceAsset Camera { get; } = new("NewMod.Resources.cam.png"); 13 | } -------------------------------------------------------------------------------- /NewMod/NewModEndReasons.cs: -------------------------------------------------------------------------------- 1 | namespace NewMod 2 | { 3 | public enum NewModEndReasons 4 | { 5 | EnergyThiefWin = 100, 6 | DoubleAgentWin = 111, 7 | PranksterWin = 112, 8 | SpecialAgentWin = 113, 9 | TheVisionaryWin = 114 10 | } 11 | } -------------------------------------------------------------------------------- /NewMod/Options/GeneralOption.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.GameOptions; 2 | using MiraAPI.GameOptions.Attributes; 3 | using MiraAPI.GameOptions.OptionTypes; 4 | using MiraAPI.Utilities; 5 | 6 | namespace NewMod.Options; 7 | 8 | public class GeneralOption : AbstractOptionGroup 9 | { 10 | public override string GroupName => "NewMod Group"; 11 | 12 | [ModdedToggleOption("Enable Teleportation")] 13 | public bool EnableTeleportation { get; set; } = true; 14 | 15 | [ModdedToggleOption("Can Open Cams")] 16 | public bool CanOpenCams {get; set;} = true; 17 | 18 | [ModdedNumberOption("Kill Distance (used by explosive modifier)", min: 5f, max: 20f, increment: 1f, MiraNumberSuffixes.None)] 19 | public float KillDistance { get; set; } = 10f; 20 | 21 | [ModdedNumberOption("ExplosiveModifier duration", min: 40f, max: 60f, increment: 1f, MiraNumberSuffixes.None)] 22 | public float Duration { get; set; } = 50f; 23 | } -------------------------------------------------------------------------------- /NewMod/Options/Roles/EnergyThiefOptions/EnergyThiefOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MiraAPI.GameOptions; 3 | using MiraAPI.GameOptions.Attributes; 4 | using MiraAPI.GameOptions.OptionTypes; 5 | using MiraAPI.Utilities; 6 | using NewMod.Roles.NeutralRoles; 7 | 8 | namespace NewMod.Options.Roles.EnergyThiefOptions; 9 | 10 | public class EnergyThiefOptions : AbstractOptionGroup 11 | { 12 | public override string GroupName => "Energy Thief"; 13 | public override Type AdvancedRole => typeof(EnergyThief); 14 | 15 | [ModdedNumberOption("Drain Cooldown", min:10, max:20, suffixType:MiraNumberSuffixes.Seconds)] 16 | public float DrainCooldown {get; set;} = 15f; 17 | 18 | [ModdedNumberOption("Drain Max Uses", min:3, max:5)] 19 | public float DrainMaxUses {get; set;} = 3f; 20 | } -------------------------------------------------------------------------------- /NewMod/Options/Roles/NecromancerOptions/NecromancerRoleOption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MiraAPI.GameOptions; 3 | using MiraAPI.GameOptions.Attributes; 4 | using MiraAPI.GameOptions.OptionTypes; 5 | using MiraAPI.Utilities; 6 | using NewMod.Roles.ImpostorRoles; 7 | 8 | namespace NewMod.Options.Roles.NecromancerOptions; 9 | 10 | public class NecromancerOption : AbstractOptionGroup 11 | { 12 | public override string GroupName => "Necromancer Role"; 13 | public override Type AdvancedRole => typeof(NecromancerRole); 14 | 15 | [ModdedNumberOption("ButtonCooldown", min:5, max:15, suffixType:MiraNumberSuffixes.Seconds)] 16 | public float ButtonCooldown {get; set;} = 6f; 17 | 18 | [ModdedNumberOption("AbilityUses", min:1, max:6)] 19 | public float AbilityUses {get; set;} = 3f; 20 | 21 | } -------------------------------------------------------------------------------- /NewMod/Options/Roles/PranksterOptions/PranksterOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MiraAPI.GameOptions; 3 | using MiraAPI.GameOptions.Attributes; 4 | using MiraAPI.GameOptions.OptionTypes; 5 | using MiraAPI.Utilities; 6 | using NewMod.Roles.NeutralRoles; 7 | 8 | namespace NewMod.Options.Roles.PranksterOptions; 9 | 10 | public class PranksterOptions : AbstractOptionGroup 11 | { 12 | public override string GroupName => "Prankster"; 13 | public override Type AdvancedRole => typeof(Prankster); 14 | 15 | [ModdedNumberOption("Prank Cooldown", min:10, max:40, suffixType:MiraNumberSuffixes.Seconds)] 16 | public float PrankCooldown {get; set;} = 20f; 17 | 18 | [ModdedNumberOption("Prank Max Uses", min:1, max:3)] 19 | public float PrankMaxUses {get; set;} = 2f; 20 | } -------------------------------------------------------------------------------- /NewMod/Options/Roles/SpecialAgentOptions/SpecialAgentOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MiraAPI.GameOptions; 3 | using MiraAPI.GameOptions.Attributes; 4 | using MiraAPI.GameOptions.OptionTypes; 5 | using NewMod.Roles.NeutralRoles; 6 | 7 | namespace NewMod.Options.Roles.SpecialAgentOptions 8 | { 9 | public class SpecialAgentOptions : AbstractOptionGroup 10 | { 11 | public override string GroupName => "Special Agent"; 12 | public override Type AdvancedRole => typeof(SpecialAgent); 13 | 14 | [ModdedNumberOption("Assign Mission Cooldown", min:10, max:30)] 15 | public float AssignCooldown { get; set; } = 20f; 16 | 17 | [ModdedNumberOption("Assign Mission Max Uses", min:1, max:3)] 18 | public float AssignMaxUses { get; set; } = 3f; 19 | 20 | [ModdedToggleOption("Enable Target Camera Tracking")] 21 | public bool TargetCameraTracking { get; set; } = true; 22 | 23 | [ModdedNumberOption("Camera Tracking Duration", min:5, max:15)] 24 | public float CameraTrackingDuration { get; set; } = 10f; 25 | 26 | [ModdedNumberOption("Required Missions to Win", min:1, max:5)] 27 | public float RequiredMissionsToWin { get; set; } = 3f; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /NewMod/Options/Roles/TheVisionaryOptions/TheVisionaryOptions.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using MiraAPI.GameOptions; 3 | using MiraAPI.GameOptions.Attributes; 4 | using MiraAPI.GameOptions.OptionTypes; 5 | using NewMod.Roles.CrewmateRoles; 6 | 7 | namespace NewMod.Options.Roles.VisionaryOptions 8 | { 9 | public class VisionaryOptions : AbstractOptionGroup 10 | { 11 | public override string GroupName => "The Visionary"; 12 | public override Type AdvancedRole => typeof(TheVisionary); 13 | 14 | [ModdedNumberOption("Screenshot Cooldown", min:5, max:30)] 15 | public float ScreenshotCooldown { get; set; } = 15f; 16 | 17 | [ModdedNumberOption("Max Screenshots", min:1, max:5)] 18 | public float MaxScreenshots { get; set; } = 3f; 19 | 20 | [ModdedNumberOption("Max Display Duration", min:5, max:10)] 21 | public float MaxDisplayDuration { get; set; } = 5f; 22 | } 23 | } -------------------------------------------------------------------------------- /NewMod/Patches/EndGamePatch.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using HarmonyLib; 3 | using NewMod.Roles.CrewmateRoles; 4 | using NewMod.Roles.NeutralRoles; 5 | using NewMod.Utilities; 6 | using System.Linq; 7 | using MiraAPI.Roles; 8 | using AmongUs.GameOptions; 9 | using Object = UnityEngine.Object; 10 | using MiraAPI.GameOptions; 11 | using NewMod.Options.Roles.SpecialAgentOptions; 12 | 13 | namespace NewMod.Patches 14 | { 15 | [HarmonyPatch(typeof(EndGameManager), nameof(EndGameManager.SetEverythingUp))] 16 | public static class SetEverythingUpPatch 17 | { 18 | public static void Postfix(EndGameManager __instance) 19 | { 20 | foreach (var playerObj in __instance.GetComponentsInChildren()) 21 | { 22 | GameObject.Destroy(playerObj.gameObject); 23 | } 24 | 25 | var winningPlayers = EndGameResult.CachedWinners.ToArray().OrderByDescending(p => !p.IsYou).ToList(); 26 | 27 | int num = winningPlayers.Count; 28 | 29 | for (int i = 0; i < num; i++) 30 | { 31 | var playerData = winningPlayers[i]; 32 | 33 | int num2 = ((i % 2 == 0) ? (-1) : 1); 34 | int num3 = (i + 1) / 2; 35 | float num4 = (float)num3 / (float)num; 36 | float num5 = Mathf.Lerp(1f, 0.75f, num4); 37 | float num6 = (i == 0) ? -8f : -1f; 38 | 39 | PoolablePlayer poolablePlayer = Object.Instantiate(__instance.PlayerPrefab, __instance.transform); 40 | 41 | float xPos = 1f * num2 * num3 * num5 * 0.9f; 42 | float yPos = FloatRange.SpreadToEdges(-1.125f, 0f, num3, num) * 0.9f; 43 | float zPos = (num6 + num3 * 0.01f) * 0.9f; 44 | 45 | poolablePlayer.transform.localPosition = new Vector3(1f * (float)num2 * (float)num3 * num5, FloatRange.SpreadToEdges(-1.125f, 0f, num3, num), num6 + (float)num3 * 0.01f) * 0.9f; 46 | poolablePlayer.transform.localScale = Vector3.one * num5; 47 | 48 | if (playerData.IsDead) 49 | { 50 | poolablePlayer.SetBodyAsGhost(); 51 | poolablePlayer.SetDeadFlipX(i % 2 == 0); 52 | } 53 | else 54 | { 55 | poolablePlayer.SetFlipX(i % 2 == 0); 56 | } 57 | poolablePlayer.UpdateFromPlayerOutfit( 58 | playerData.Outfit, 59 | PlayerMaterial.MaskType.None, 60 | playerData.IsDead, 61 | true, 62 | null, 63 | false 64 | ); 65 | 66 | string roleName = GetRoleName(playerData, out Color roleColor); 67 | 68 | string playerNameWithRole = $"{playerData.PlayerName}\n{roleName}"; 69 | 70 | var nameText = poolablePlayer.cosmetics.nameText; 71 | 72 | nameText.transform.localPosition = new Vector3(0f, -1.5f, -15f); 73 | 74 | nameText.text = playerNameWithRole; 75 | nameText.color = roleColor; 76 | nameText.alignment = TMPro.TextAlignmentOptions.Center; 77 | } 78 | 79 | string customWinText; 80 | Color customWinColor; 81 | 82 | switch (EndGameResult.CachedGameOverReason) 83 | { 84 | case (GameOverReason)NewModEndReasons.EnergyThiefWin: 85 | customWinText = "Energy Thief Win!"; 86 | customWinColor = GetRoleColor(GetRoleType()); 87 | __instance.BackgroundBar.material.SetColor("_Color", customWinColor); 88 | break; 89 | 90 | case (GameOverReason)NewModEndReasons.DoubleAgentWin: 91 | customWinText = "Double Agent Win!"; 92 | customWinColor = GetRoleColor(GetRoleType()); 93 | __instance.BackgroundBar.material.SetColor("_Color", customWinColor); 94 | break; 95 | case (GameOverReason)NewModEndReasons.PranksterWin: 96 | customWinText = "Prankster Win!"; 97 | customWinColor = GetRoleColor(GetRoleType()); 98 | __instance.BackgroundBar.material.SetColor("_Color", customWinColor); 99 | break; 100 | case (GameOverReason)NewModEndReasons.SpecialAgentWin: 101 | customWinText = "Special Agent Victory"; 102 | customWinColor = GetRoleColor(GetRoleType()); 103 | __instance.BackgroundBar.material.SetColor("_Color", customWinColor); 104 | break; 105 | default: 106 | customWinText = string.Empty; 107 | customWinColor = Color.white; 108 | break; 109 | } 110 | 111 | if (!string.IsNullOrEmpty(customWinText)) 112 | { 113 | var customWinTextObject = GameObject.Instantiate(__instance.WinText.gameObject, __instance.transform); 114 | customWinTextObject.transform.localPosition = new Vector3(__instance.WinText.transform.position.x, __instance.WinText.transform.position.y - 0.5f, __instance.WinText.transform.position.z); 115 | customWinTextObject.transform.localScale = new Vector3(0.7f, 0.7f, 1f); 116 | var customWinTextComponent = customWinTextObject.GetComponent(); 117 | customWinTextComponent.text = customWinText; 118 | customWinTextComponent.color = customWinColor; 119 | customWinTextComponent.fontSize = 4f; 120 | } 121 | } 122 | 123 | public static string GetRoleName(CachedPlayerData playerData, out Color roleColor) 124 | { 125 | RoleTypes roleType = playerData.RoleWhenAlive; 126 | RoleBehaviour roleBehaviour = RoleManager.Instance.GetRole(roleType); 127 | 128 | if (roleBehaviour != null) 129 | { 130 | if (CustomRoleManager.GetCustomRoleBehaviour(roleType, out var customRole)) 131 | { 132 | roleColor = customRole.RoleColor; 133 | return customRole.RoleName; 134 | } 135 | else 136 | { 137 | roleColor = roleBehaviour.NameColor; 138 | return roleBehaviour.NiceName; 139 | } 140 | } 141 | else 142 | { 143 | roleColor = Color.white; 144 | return null; 145 | } 146 | } 147 | 148 | public static RoleTypes GetRoleType() where T : RoleBehaviour 149 | { 150 | ushort roleId = RoleId.Get(); 151 | return (RoleTypes)roleId; 152 | } 153 | 154 | public static Color GetRoleColor(RoleTypes roleType) 155 | { 156 | RoleBehaviour roleBehaviour = RoleManager.Instance.GetRole(roleType); 157 | 158 | if (roleBehaviour != null) 159 | { 160 | if (CustomRoleManager.GetCustomRoleBehaviour(roleType, out var customRole)) 161 | { 162 | return customRole.RoleColor; 163 | } 164 | else 165 | { 166 | return roleBehaviour.NameColor; 167 | } 168 | } 169 | else 170 | { 171 | return Color.white; 172 | } 173 | } 174 | } 175 | 176 | [HarmonyPatch(typeof(LogicGameFlowNormal), nameof(LogicGameFlowNormal.CheckEndCriteria))] 177 | public static class CheckGameEndPatch 178 | { 179 | public static bool Prefix(ShipStatus __instance) 180 | { 181 | if (DestroyableSingleton.InstanceExists) return true; 182 | if (CheckEndGameForEnergyThief(__instance)) return false; 183 | if (CheckEndGameForDoubleAgent(__instance)) return false; 184 | if (CheckEndGameForPrankster(__instance)) return false; 185 | if (CheckEndGameForSpecialAgent(__instance)) return false; 186 | return true; 187 | } 188 | 189 | public static bool CheckEndGameForEnergyThief(ShipStatus __instance) 190 | { 191 | if (PlayerControl.LocalPlayer != null && PlayerControl.LocalPlayer.Data.Role is EnergyThief) 192 | { 193 | int drainCount = Utils.GetDrainCount(PlayerControl.LocalPlayer.PlayerId); 194 | if (drainCount > 3) 195 | { 196 | GameManager.Instance.RpcEndGame((GameOverReason)NewModEndReasons.EnergyThiefWin, false); 197 | StatsManager.Instance.AddWinReason((GameOverReason)NewModEndReasons.DoubleAgentWin, (int)GameManager.Instance.LogicOptions.MapId, (RoleTypes)RoleId.Get()); 198 | return true; 199 | } 200 | } 201 | return false; 202 | } 203 | 204 | public static bool CheckEndGameForDoubleAgent(ShipStatus __instance) 205 | { 206 | if (PlayerControl.LocalPlayer != null && PlayerControl.LocalPlayer.Data.Role is DoubleAgent) 207 | { 208 | bool tasksCompleted = PlayerControl.LocalPlayer.AllTasksCompleted(); 209 | bool isSabotageActive = Utils.IsSabotage(); 210 | if (tasksCompleted && isSabotageActive) 211 | { 212 | GameManager.Instance.RpcEndGame((GameOverReason)NewModEndReasons.DoubleAgentWin, false); 213 | StatsManager.Instance.AddWinReason((GameOverReason)NewModEndReasons.DoubleAgentWin, (int)GameManager.Instance.LogicOptions.MapId, (RoleTypes)RoleId.Get()); 214 | return true; 215 | } 216 | } 217 | return false; 218 | } 219 | public static bool CheckEndGameForPrankster(ShipStatus __instance) 220 | { 221 | if (PlayerControl.LocalPlayer != null && PlayerControl.LocalPlayer.Data.Role is Prankster) 222 | { 223 | int WinReportCount = 2; 224 | int currentReportCount = PranksterUtilities.GetReportCount(PlayerControl.LocalPlayer.PlayerId); 225 | if (currentReportCount >= WinReportCount) 226 | { 227 | GameManager.Instance.RpcEndGame((GameOverReason)NewModEndReasons.PranksterWin, false); 228 | StatsManager.Instance.AddWinReason((GameOverReason)NewModEndReasons.PranksterWin, (int)GameManager.Instance.LogicOptions.MapId, (RoleTypes)RoleId.Get()); 229 | return true; 230 | } 231 | } 232 | return false; 233 | } 234 | public static bool CheckEndGameForSpecialAgent(ShipStatus __instance) 235 | { 236 | if (PlayerControl.LocalPlayer != null && PlayerControl.LocalPlayer.Data.Role is SpecialAgent) 237 | { 238 | int missionSuccessCount = Utils.GetMissionSuccessCount(PlayerControl.LocalPlayer.PlayerId); 239 | int missionFailureCount = Utils.GetMissionFailureCount(PlayerControl.LocalPlayer.PlayerId); 240 | int netScore = missionSuccessCount - missionFailureCount; 241 | 242 | if (netScore >= OptionGroupSingleton.Instance.RequiredMissionsToWin) 243 | { 244 | GameManager.Instance.RpcEndGame((GameOverReason)NewModEndReasons.SpecialAgentWin, false); 245 | StatsManager.Instance.AddWinReason((GameOverReason)NewModEndReasons.SpecialAgentWin, (int)GameManager.Instance.LogicOptions.MapId, (RoleTypes)RoleId.Get()); 246 | return true; 247 | } 248 | } 249 | return false; 250 | } 251 | } 252 | } -------------------------------------------------------------------------------- /NewMod/Patches/HauntMenuMinigamePatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using MiraAPI.Roles; 3 | 4 | namespace NewMod.Patches 5 | { 6 | [HarmonyPatch(typeof(HauntMenuMinigame), nameof(HauntMenuMinigame.SetFilterText))] 7 | public static class HauntMenuMinigamePatch 8 | { 9 | public static bool Prefix(HauntMenuMinigame __instance) 10 | { 11 | var targetData = __instance.HauntTarget.Data; 12 | 13 | if (targetData.Role is ICustomRole customRole) 14 | { 15 | __instance.FilterText.text = customRole.RoleName; 16 | return false; 17 | } 18 | else 19 | { 20 | __instance.FilterText.text = targetData.Role.NiceName; 21 | } 22 | return false; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /NewMod/Patches/LogoPatch.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using HarmonyLib; 3 | 4 | namespace NewMod.Patches 5 | { 6 | [HarmonyPatch(typeof(MainMenuManager), nameof(MainMenuManager.Start))] 7 | [HarmonyPriority(Priority.High)] 8 | public static class NewModLogoPatch 9 | { 10 | public static SpriteRenderer LogoSprite; 11 | 12 | [HarmonyPostfix] 13 | public static void StartPostfix(MainMenuManager __instance) 14 | { 15 | var newparent = __instance.gameModeButtons.transform.parent; 16 | var Logo = new GameObject("NewmodLogo"); 17 | Logo.transform.parent = newparent; 18 | Logo.transform.localPosition = new(0f, -0.07f, 1f); 19 | LogoSprite = Logo.AddComponent(); 20 | LogoSprite.sprite = NewModAsset.ModLogo.LoadAsset(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /NewMod/Patches/QuitPatch.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using HarmonyLib; 4 | using NewMod.Utilities; 5 | using UnityEngine; 6 | 7 | namespace NewMod.Patches.Roles.EnergyThief; 8 | 9 | [HarmonyPatch(typeof(Application), nameof(Application.Quit), new Type[] { })] 10 | public static class QuitPatch 11 | { 12 | public static bool Prefix(Application __instance) 13 | { 14 | VisionaryUtilities.DeleteAllScreenshots(); 15 | NewMod.Instance.Log.LogMessage("Deleted all Visionary's screenshots Successfully"); 16 | Process.GetCurrentProcess().Kill(); 17 | return false; 18 | } 19 | } -------------------------------------------------------------------------------- /NewMod/Patches/Roles/EnergyThief/OnGameEnd.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using MiraAPI.Hud; 3 | using NewMod.Utilities; 4 | using NewMod.Buttons; 5 | 6 | namespace NewMod.Patches.Roles.EnergyThief; 7 | 8 | [HarmonyPatch(typeof(AmongUsClient), nameof(AmongUsClient.OnGameEnd))] 9 | public static class OnGameEndPatch 10 | { 11 | public static void Postfix(AmongUsClient __instance, [HarmonyArgument(0)] EndGameResult endGameResult) 12 | { 13 | Utils.ResetDrainCount(); 14 | Utils.ResetMissionSuccessCount(); 15 | Utils.ResetMissionFailureCount(); 16 | PranksterUtilities.ResetReportCount(); 17 | VisionaryUtilities.DeleteAllScreenshots(); 18 | NewMod.Instance.Log.LogInfo("Reset Drain Count Successfully"); 19 | NewMod.Instance.Log.LogInfo("Reset Clone Report Count Successfully"); 20 | NewMod.Instance.Log.LogInfo("Reset Mission Success Count Successfully"); 21 | NewMod.Instance.Log.LogInfo("Reset Mission Failure Count Successfully"); 22 | NewMod.Instance.Log.LogInfo("Deleted all Visionary's screenshots Successfully"); 23 | } 24 | } -------------------------------------------------------------------------------- /NewMod/Patches/Roles/MeetingHudPatch.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using HarmonyLib; 3 | using NewMod.Utilities; 4 | using System.Linq; 5 | using Il2CppInterop.Runtime.InteropTypes.Arrays; 6 | using AmongUs.GameOptions; 7 | 8 | namespace NewMod.Patches.Roles 9 | { 10 | public static class MeetingHudPatches 11 | { 12 | [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.OnDestroy))] 13 | public static class MeetingHud_OnDestroy_Patch 14 | { 15 | public static void Postfix(MeetingHud __instance) 16 | { 17 | PendingEffectManager.ApplyPendingEffects(); 18 | } 19 | } 20 | [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.CoIntro))] 21 | public static class MeetingHud_CoIntro_Patch 22 | { 23 | public static bool Prefix(ref Il2CppReferenceArray deadBodies) 24 | { 25 | List pranksterBodies = PranksterUtilities.FindAllPranksterBodies(); 26 | deadBodies = new Il2CppReferenceArray( 27 | deadBodies 28 | .Where(deadBody => !pranksterBodies.Any(pb => pb.ParentId == deadBody.PlayerId)) 29 | .ToArray()); 30 | 31 | return true; 32 | } 33 | } 34 | [HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.PopulateButtons))] 35 | public static class MeetingHud_PopulateButtons_Patch 36 | { 37 | public static bool Prefix(MeetingHud __instance, byte reporter) 38 | { 39 | var fakeBodies = PranksterUtilities.FindAllPranksterBodies(); 40 | var voteArea = GameData.Instance.AllPlayers 41 | .ToArray() 42 | .Where(player => 43 | !player.IsDead && 44 | !fakeBodies.Any(body => body.ParentId == player.PlayerId) 45 | ) 46 | .Select(player => 47 | { 48 | PlayerVoteArea voteArea = __instance.CreateButton(player); 49 | voteArea.SetTargetPlayerId(player.PlayerId); 50 | voteArea.SetDead(false, player.Disconnected || player.IsDead, player.Role?.Role == RoleTypes.GuardianAngel); 51 | return voteArea; 52 | }); 53 | __instance.playerStates = new Il2CppReferenceArray(voteArea.ToArray()); 54 | __instance.SortButtons(); 55 | return false; 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /NewMod/Patches/Roles/Prankster/DeadBodyPatch.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using NewMod.Utilities; 3 | 4 | namespace NewMod.Patches.Roles.Prankster 5 | { 6 | [HarmonyPatch(typeof(DeadBody), nameof(DeadBody.OnClick))] 7 | public static class DeadBodyOnClickPatch 8 | { 9 | public static bool Prefix(DeadBody __instance) 10 | { 11 | if (!__instance.Reported && PranksterUtilities.IsPranksterBody(__instance)) 12 | { 13 | var reporter = PlayerControl.LocalPlayer; 14 | 15 | reporter.RpcMurderPlayer(reporter, true); 16 | 17 | byte pranksterId = __instance.ParentId; 18 | 19 | PranksterUtilities.IncrementReportCount(pranksterId); 20 | 21 | return false; 22 | } 23 | return true; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /NewMod/Patches/Roles/Visionary/VisionaryPatches.cs: -------------------------------------------------------------------------------- 1 | using HarmonyLib; 2 | using MiraAPI.GameOptions; 3 | using MiraAPI.Networking; 4 | using MiraAPI.Roles; 5 | using NewMod.Options.Roles.VisionaryOptions; 6 | using NewMod.Roles.CrewmateRoles; 7 | using NewMod.Utilities; 8 | using Reactor.Utilities; 9 | using UnityEngine; 10 | 11 | namespace NewMod.Patches.Roles.Visionary 12 | { 13 | [HarmonyPatch(typeof(PlayerPhysics), nameof(PlayerPhysics.RpcEnterVent))] 14 | public static class VisionaryVentPatch 15 | { 16 | public static bool Prefix(PlayerPhysics __instance, int id) 17 | { 18 | float chance = 0.3f; 19 | if (Random.Range(0f, 1f) < chance) 20 | { 21 | var timestamp = System.DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm-ss"); 22 | string filePath = System.IO.Path.Combine( 23 | VisionaryUtilities.ScreenshotDirectory, 24 | $"screenshot_{timestamp}.png" 25 | ); 26 | Coroutines.Start(Utils.CaptureScreenshot(filePath)); 27 | 28 | if (__instance.myPlayer.AmOwner) 29 | { 30 | Coroutines.Start(CoroutinesHelper.CoNotify("Warning: Visionary might have seen you vent!")); 31 | } 32 | } 33 | return true; 34 | } 35 | 36 | [HarmonyPatch(typeof(PlayerPhysics), nameof(PlayerPhysics.RpcExitVent))] 37 | [HarmonyPrefix] 38 | public static bool StartPrefix(PlayerPhysics __instance, int id) 39 | { 40 | float chance = 0.3f; 41 | if (Random.Range(0f, 1f) < chance) 42 | { 43 | var timestamp = System.DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm-ss"); 44 | string filePath = System.IO.Path.Combine( 45 | VisionaryUtilities.ScreenshotDirectory, 46 | $"screenshot_{timestamp}.png" 47 | ); 48 | Coroutines.Start(Utils.CaptureScreenshot(filePath)); 49 | 50 | if (__instance.myPlayer.AmOwner) 51 | { 52 | Coroutines.Start(CoroutinesHelper.CoNotify("Warning: Visionary might have seen you exit vent!")); 53 | } 54 | } 55 | return true; 56 | } 57 | } 58 | public static class VisionaryMurderPatch 59 | { 60 | [HarmonyPatch(typeof(CustomMurderRpc), nameof(CustomMurderRpc.RpcCustomMurder))] 61 | [HarmonyPrefix] 62 | public static bool StartPrefix(PlayerControl target, bool didSucceed, bool resetKillTimer, bool createDeadBody, bool teleportMurderer, bool showKillAnim, bool playKillSound) 63 | { 64 | float chance = 0.5f; 65 | if (Random.Range(0f, 1f) < chance) 66 | { 67 | var timestamp = System.DateTime.UtcNow.ToString("yyyy-MM-dd_HH-mm-ss"); 68 | string filePath = System.IO.Path.Combine( 69 | VisionaryUtilities.ScreenshotDirectory, 70 | $"screenshot_{timestamp}.png" 71 | ); 72 | Coroutines.Start(Utils.CaptureScreenshot(filePath)); 73 | 74 | if (PlayerControl.LocalPlayer.AmOwner) 75 | { 76 | Coroutines.Start(CoroutinesHelper.CoNotify("Warning: The Visionary may have captured your crime!")); 77 | } 78 | } 79 | return true; 80 | } 81 | } 82 | public static class VisionaryChatPatch 83 | { 84 | [HarmonyPatch(typeof(ChatController), nameof(ChatController.SetVisible))] 85 | [HarmonyPrefix] 86 | public static bool StartPrefix(ChatController __instance, bool visible) 87 | { 88 | if (PlayerControl.LocalPlayer.Data.Role is not ICustomRole) return true; 89 | if (MeetingHud.Instance) return true; 90 | 91 | bool allowChat = VisionaryUtilities.CapturedScreenshotPaths.Count > 2; 92 | if (allowChat) 93 | { 94 | __instance.gameObject.SetActive(true); 95 | } 96 | else 97 | { 98 | __instance.gameObject.SetActive(false); 99 | } 100 | return false; 101 | } 102 | [HarmonyPatch(typeof(ChatController), nameof(ChatController.SendChat))] 103 | [HarmonyPrefix] 104 | public static bool StartPrefix(ChatController __instance) 105 | { 106 | if (PlayerControl.LocalPlayer.Data.Role is not ICustomRole) return true; 107 | if (PlayerControl.LocalPlayer.Data.Role is not TheVisionary) return true; 108 | string chatText = __instance.freeChatField.Text; 109 | 110 | if (chatText.ToLower().StartsWith("/") && chatText.Length > 1) 111 | { 112 | string commandPart = chatText[1..].Trim(); 113 | if (int.TryParse(commandPart, out var index)) 114 | { 115 | int zeroBased = index - 1; 116 | 117 | if (zeroBased >= 0 && zeroBased < VisionaryUtilities.CapturedScreenshotPaths.Count) 118 | { 119 | string path = VisionaryUtilities.CapturedScreenshotPaths[zeroBased]; 120 | Coroutines.Start(VisionaryUtilities.ShowScreenshotByPath(path, OptionGroupSingleton.Instance.MaxDisplayDuration)); 121 | Coroutines.Start(CoroutinesHelper.CoNotify($"Showing screenshot #{index}!")); 122 | } 123 | else 124 | { 125 | Coroutines.Start(CoroutinesHelper.CoNotify($"Screenshot #{index} not found.")); 126 | } 127 | } 128 | } 129 | return false; 130 | } 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /NewMod/Patches/StatsPopupPatch.cs: -------------------------------------------------------------------------------- 1 | using AmongUs.GameOptions; 2 | using UnityEngine; 3 | using HarmonyLib; 4 | using MiraAPI.Roles; 5 | using Il2CppSystem.Text; 6 | 7 | namespace NewMod.Patches 8 | { 9 | [HarmonyPatch(typeof(StatsPopup), nameof(StatsPopup.DisplayRoleStats))] 10 | public class DisplayRoleStatsPatch 11 | { 12 | public static bool Prefix(StatsPopup __instance) 13 | { 14 | StringBuilder stringBuilder = new StringBuilder(); 15 | 16 | var allRoles = RoleManager.Instance.AllRoles; 17 | 18 | foreach (var role in allRoles) 19 | { 20 | RoleTypes roleType = role.Role; 21 | 22 | if (roleType == RoleTypes.ImpostorGhost || roleType == RoleTypes.CrewmateGhost) 23 | { 24 | continue; 25 | } 26 | 27 | var winCount = StatsManager.Instance.GetRoleWinCount(roleType); 28 | 29 | string roleName; 30 | Color roleColor; 31 | 32 | if (role is ICustomRole customRole) 33 | { 34 | roleName = customRole.RoleName; 35 | roleColor = customRole.RoleColor; 36 | } 37 | else 38 | { 39 | roleName = role.NiceName; 40 | roleColor = role.NameColor; 41 | } 42 | 43 | StatsPopup.AppendStat(stringBuilder, StringNames.StatsRoleWins, winCount, $"{roleName}"); 44 | } 45 | 46 | foreach (StringNames stringName in StatsPopup.RoleSpecificStatsToShow) 47 | { 48 | StatsPopup.AppendStat(stringBuilder, stringName, StatsManager.Instance.GetStat(stringName)); 49 | } 50 | 51 | __instance.StatsText.text = stringBuilder.ToString(); 52 | 53 | return false; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /NewMod/PendingEffectManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using NewMod.Utilities; 3 | 4 | namespace NewMod 5 | { 6 | public static class PendingEffectManager 7 | { 8 | public static HashSet pendingEffects = new HashSet(); 9 | public static void AddPendingEffect(PlayerControl target) 10 | { 11 | if (target != null && !pendingEffects.Contains(target)) 12 | { 13 | pendingEffects.Add(target); 14 | } 15 | } 16 | public static void RemovePendingEffect(PlayerControl target) 17 | { 18 | if (target != null && pendingEffects.Contains(target)) 19 | { 20 | pendingEffects.Remove(target); 21 | } 22 | } 23 | public static void ApplyPendingEffects() 24 | { 25 | foreach (var target in pendingEffects) 26 | { 27 | if (target != null && !target.Data.IsDead && !target.Data.Disconnected) 28 | { 29 | Utils.RpcRandomDrainActions(PlayerControl.LocalPlayer, target); 30 | } 31 | } 32 | pendingEffects.Clear(); 33 | Utils.waitingPlayers.Clear(); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /NewMod/Resources/Arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CallOfCreator/NewMod/55ea31f81eb235ff540d9473d3edcd6f28bd0ee3/NewMod/Resources/Arrow.png -------------------------------------------------------------------------------- /NewMod/Resources/Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CallOfCreator/NewMod/55ea31f81eb235ff540d9473d3edcd6f28bd0ee3/NewMod/Resources/Logo.png -------------------------------------------------------------------------------- /NewMod/Resources/Revive2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CallOfCreator/NewMod/55ea31f81eb235ff540d9473d3edcd6f28bd0ee3/NewMod/Resources/Revive2.png -------------------------------------------------------------------------------- /NewMod/Resources/cam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CallOfCreator/NewMod/55ea31f81eb235ff540d9473d3edcd6f28bd0ee3/NewMod/Resources/cam.png -------------------------------------------------------------------------------- /NewMod/Resources/deadbody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CallOfCreator/NewMod/55ea31f81eb235ff540d9473d3edcd6f28bd0ee3/NewMod/Resources/deadbody.png -------------------------------------------------------------------------------- /NewMod/Resources/optionImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CallOfCreator/NewMod/55ea31f81eb235ff540d9473d3edcd6f28bd0ee3/NewMod/Resources/optionImage.png -------------------------------------------------------------------------------- /NewMod/Roles/CrewmateRoles/DoubleAgent.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.Roles; 2 | using UnityEngine; 3 | using MiraAPI.Utilities.Assets; 4 | 5 | namespace NewMod.Roles.CrewmateRoles; 6 | 7 | [RegisterCustomRole] 8 | public class DoubleAgent : CrewmateRole, ICustomRole 9 | { 10 | public string RoleName => "Double Agent"; 11 | public string RoleDescription => $"A Crewmate posing as an Impostor: You can't kill or vent, but you can sabotage and confuse the real Impostors. Complete all tasks and sabotage to win\n\nTeam: {Team}."; 12 | public string RoleLongDescription => RoleDescription; 13 | public Color RoleColor => Palette.ImpostorRed; 14 | public ModdedRoleTeams Team => ModdedRoleTeams.Crewmate; 15 | public CustomRoleConfiguration Configuration => new(this) 16 | { 17 | MaxRoleCount = 1, 18 | OptionsScreenshot = MiraAssets.Empty, 19 | Icon = MiraAssets.Empty, 20 | CanGetKilled = true, 21 | UseVanillaKillButton = false, 22 | CanUseVent = false, 23 | TasksCountForProgress = true, 24 | CanUseSabotage = true, 25 | DefaultChance = 50, 26 | DefaultRoleCount = 2, 27 | CanModifyChance = true, 28 | RoleHintType = RoleHintType.RoleTab 29 | }; 30 | 31 | public override bool DidWin(GameOverReason gameOverReason) 32 | { 33 | return gameOverReason == (GameOverReason)NewModEndReasons.DoubleAgentWin; 34 | } 35 | } -------------------------------------------------------------------------------- /NewMod/Roles/CrewmateRoles/TheVisionary.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.Roles; 2 | using UnityEngine; 3 | using MiraAPI.Utilities.Assets; 4 | 5 | namespace NewMod.Roles.CrewmateRoles; 6 | 7 | [RegisterCustomRole] 8 | public class TheVisionary : CrewmateRole, ICustomRole 9 | { 10 | public string RoleName => "TheVisionary"; 11 | public string RoleDescription => $"Take photos during the game"; 12 | public string RoleLongDescription => "Capture key moments during the game by taking photos to gather evidence"; 13 | public Color RoleColor => new(0.75f, 0.5f, 1.0f); 14 | public ModdedRoleTeams Team => ModdedRoleTeams.Crewmate; 15 | public CustomRoleConfiguration Configuration => new(this) 16 | { 17 | DefaultRoleCount = 2, 18 | DefaultChance = 50, 19 | MaxRoleCount = 3, 20 | AffectedByLightOnAirship = true, 21 | CanGetKilled = true, 22 | UseVanillaKillButton = false, 23 | CanUseVent = false, 24 | TasksCountForProgress = true, 25 | Icon = MiraAssets.Empty, 26 | OptionsScreenshot = MiraAssets.Empty, 27 | CanModifyChance = true, 28 | RoleHintType = RoleHintType.RoleTab 29 | }; 30 | public override bool DidWin(GameOverReason gameOverReason) 31 | { 32 | return gameOverReason == (GameOverReason)NewModEndReasons.TheVisionaryWin; 33 | } 34 | } -------------------------------------------------------------------------------- /NewMod/Roles/ImpostorRoles/Necromancer.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.GameOptions; 2 | using MiraAPI.Roles; 3 | using MiraAPI.Utilities; 4 | using MiraAPI.Utilities.Assets; 5 | using NewMod.Options; 6 | using UnityEngine; 7 | 8 | namespace NewMod.Roles.ImpostorRoles; 9 | 10 | [RegisterCustomRole] 11 | public class NecromancerRole : ImpostorRole, ICustomRole 12 | { 13 | public string RoleName => "Necromancer"; 14 | public string RoleDescription => "You can revive dead players who weren't killed by you"; 15 | public string RoleLongDescription => "As the Necromancer, you possess a unique and powerful ability: the power to bring one dead player back to life. However,\nyou can only revive someone who wasn't killed by you" + (OptionGroupSingleton.Instance.EnableTeleportation ? "\nPress F3 for Teleportation" : ""); 16 | public Color RoleColor => Palette.AcceptedGreen.GetAlternateColor(); 17 | public ModdedRoleTeams Team => ModdedRoleTeams.Impostor; 18 | 19 | public CustomRoleConfiguration Configuration => new(this) 20 | { 21 | Icon = MiraAssets.Empty, 22 | OptionsScreenshot = NewModAsset.Banner, 23 | MaxRoleCount = 3 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /NewMod/Roles/NeutralRoles/EnergyThief.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.Roles; 2 | using MiraAPI.Utilities; 3 | using MiraAPI.Utilities.Assets; 4 | using UnityEngine; 5 | 6 | namespace NewMod.Roles.NeutralRoles; 7 | 8 | [RegisterCustomRole] 9 | public class EnergyThief : CrewmateRole, ICustomRole 10 | { 11 | public string RoleName => "EnergyThief"; 12 | public string RoleDescription => "Drains energy from others, making them weak"; 13 | public string RoleLongDescription => $"The Energy Thief can drain energy from Crewmates or Impostors, weakening them and gaining temporary buffs\nDrain 3 players to win."; 14 | public Color RoleColor => Color.magenta.GetAlternateColor(); 15 | public ModdedRoleTeams Team => ModdedRoleTeams.Neutral; 16 | public CustomRoleConfiguration Configuration => new(this) 17 | { 18 | MaxRoleCount = 5, 19 | AffectedByLightOnAirship = false, 20 | CanGetKilled = true, 21 | UseVanillaKillButton = false, 22 | CanUseVent = false, 23 | TasksCountForProgress = false, 24 | Icon = MiraAssets.Empty, 25 | OptionsScreenshot = MiraAssets.Empty, 26 | DefaultChance = 50, 27 | DefaultRoleCount = 2, 28 | CanModifyChance = true, 29 | RoleHintType = RoleHintType.RoleTab 30 | }; 31 | public override bool DidWin(GameOverReason gameOverReason) 32 | { 33 | return gameOverReason == (GameOverReason)NewModEndReasons.EnergyThiefWin; 34 | } 35 | } -------------------------------------------------------------------------------- /NewMod/Roles/NeutralRoles/Prankster.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.Roles; 2 | using MiraAPI.Utilities; 3 | using MiraAPI.Utilities.Assets; 4 | using UnityEngine; 5 | 6 | namespace NewMod.Roles.NeutralRoles; 7 | 8 | [RegisterCustomRole] 9 | public class Prankster : CrewmateRole, ICustomRole 10 | { 11 | public string RoleName => "Prankster"; 12 | public string RoleDescription => "Set up fake bodies to trick others. When reported, each fake body triggers a funny or deadly surprise for the reporter"; 13 | public string RoleLongDescription => RoleDescription; 14 | public Color RoleColor => new Color(1f, 0.55f, 0f); 15 | public ModdedRoleTeams Team => ModdedRoleTeams.Neutral; 16 | public CustomRoleConfiguration Configuration => new(this) 17 | { 18 | MaxRoleCount = 3, 19 | DefaultRoleCount = 1, 20 | DefaultChance = 30, 21 | OptionsScreenshot = MiraAssets.Empty, 22 | Icon = MiraAssets.Empty, 23 | AffectedByLightOnAirship = false, 24 | KillButtonOutlineColor = RoleColor, 25 | RoleHintType = RoleHintType.RoleTab, 26 | GhostRole = AmongUs.GameOptions.RoleTypes.CrewmateGhost, 27 | CanGetKilled = true, 28 | UseVanillaKillButton = false, 29 | CanUseVent = false, 30 | CanUseSabotage = false, 31 | TasksCountForProgress = false, 32 | IsGhostRole = false, 33 | HideSettings = false, 34 | CanModifyChance = true, 35 | }; 36 | 37 | } -------------------------------------------------------------------------------- /NewMod/Roles/NeutralRoles/SpecialAgent.cs: -------------------------------------------------------------------------------- 1 | using MiraAPI.Roles; 2 | using MiraAPI.Utilities; 3 | using MiraAPI.Utilities.Assets; 4 | using UnityEngine; 5 | 6 | namespace NewMod.Roles.NeutralRoles; 7 | 8 | [RegisterCustomRole] 9 | public class SpecialAgent : CrewmateRole, ICustomRole 10 | { 11 | public static PlayerControl AssignedPlayer {get; set;} 12 | public string RoleName => "Special Agent"; 13 | public string RoleDescription => "Assigns secret missions to players, who must complete them or face consequences."; 14 | public string RoleLongDescription => RoleDescription; 15 | public Color RoleColor => Color.gray; 16 | public ModdedRoleTeams Team => ModdedRoleTeams.Neutral; 17 | public CustomRoleConfiguration Configuration => new(this) 18 | { 19 | MaxRoleCount = 1, 20 | AffectedByLightOnAirship = false, 21 | CanGetKilled = true, 22 | UseVanillaKillButton = false, 23 | CanUseVent = false, 24 | TasksCountForProgress = false, 25 | Icon = MiraAssets.Empty, 26 | OptionsScreenshot = MiraAssets.Empty, 27 | DefaultChance = 40, 28 | DefaultRoleCount = 1, 29 | CanModifyChance = true, 30 | RoleHintType = RoleHintType.RoleTab 31 | }; 32 | public override bool DidWin(GameOverReason gameOverReason) 33 | { 34 | return gameOverReason == (GameOverReason)NewModEndReasons.SpecialAgentWin; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /NewMod/Utilities/CoroutinesHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using Reactor.Utilities; 5 | using MiraAPI.Utilities; 6 | using System.Linq; 7 | using TMPro; 8 | using MiraAPI.Networking; 9 | 10 | namespace NewMod.Utilities 11 | { 12 | public static class CoroutinesHelper 13 | { 14 | public static Dictionary bodiesCreated = new Dictionary(); 15 | public static Dictionary drainCount = new Dictionary(); 16 | private static TextMeshPro timerLabel; 17 | 18 | public static IEnumerator CoNotify(string message) 19 | { 20 | if (Constants.ShouldPlaySfx()) 21 | { 22 | SoundManager.Instance.PlaySound(HudManager.Instance.TaskCompleteSound, false, 1f, null); 23 | } 24 | 25 | HudManager.Instance.TaskCompleteOverlay.gameObject.SetActive(true); 26 | 27 | var textComponent = HudManager.Instance.TaskCompleteOverlay.GetComponentInChildren(); 28 | 29 | if (textComponent != null) 30 | { 31 | textComponent.text = message; 32 | textComponent.fontSize = Mathf.Clamp(3.5f - (message.Length / 20f), 2f, 3.5f); 33 | } 34 | 35 | yield return Effects.Slide2D(HudManager.Instance.TaskCompleteOverlay, new Vector2(0f, -8f), Vector2.zero, 0.25f); 36 | 37 | for (float time = 0f; time < 0.95f; time += Time.deltaTime) 38 | { 39 | yield return null; 40 | } 41 | 42 | yield return Effects.Slide2D(HudManager.Instance.TaskCompleteOverlay, Vector2.zero, new Vector2(0f, 8f), 0.25f); 43 | 44 | HudManager.Instance.TaskCompleteOverlay.gameObject.SetActive(false); 45 | } 46 | 47 | public static IEnumerator CoMissionTimer(PlayerControl target, float duration) 48 | { 49 | duration = Mathf.Min(duration, 30f); 50 | 51 | timerLabel = Helpers.CreateTextLabel("MissionTimerText", HudManager.Instance.transform, AspectPosition.EdgeAlignments.LeftTop, new(10, 1.5f, 0f), fontSize:3f, textAlignment: TextAlignmentOptions.Left); 52 | 53 | timerLabel!.text = $"Time Remaining: {duration}s"; 54 | timerLabel.color = Color.yellow; 55 | 56 | float timeRemaining = duration; 57 | 58 | while (timeRemaining > 0) 59 | { 60 | yield return new WaitForSeconds(1f); 61 | timeRemaining -= 1f; 62 | 63 | timerLabel.text = $"Time Remaining: {Mathf.CeilToInt(timeRemaining)}s"; 64 | 65 | if (timeRemaining <= 10f) 66 | { 67 | timerLabel.color = Color.red; 68 | if (Constants.ShouldPlaySfx()) 69 | { 70 | SoundManager.Instance.PlaySound(ShipStatus.Instance.SabotageSound, false, 0.8f); 71 | } 72 | HudManager.Instance.FullScreen.color = new Color(1f, 0f, 0f, 0.1f); 73 | HudManager.Instance.FullScreen.gameObject.SetActive(true); 74 | } 75 | else if (timeRemaining <= 20f) 76 | { 77 | timerLabel.color = Color.yellow; 78 | } 79 | else 80 | { 81 | timerLabel.color = Color.green; 82 | } 83 | } 84 | Object.Destroy(timerLabel.gameObject); 85 | Utils.MissionFails(target, PlayerControl.LocalPlayer); 86 | } 87 | 88 | public static IEnumerator UsePranksterAbilities(PlayerControl target) 89 | { 90 | if (!bodiesCreated.ContainsKey(target.PlayerId)) 91 | { 92 | bodiesCreated[target.PlayerId] = 0; 93 | } 94 | while (true) 95 | { 96 | if (target.Data.IsDead) 97 | { 98 | Utils.MissionFails(target, PlayerControl.LocalPlayer); 99 | yield break; 100 | } 101 | 102 | if (Input.GetKeyDown(KeyCode.F5)) 103 | { 104 | PranksterUtilities.CreatePranksterDeadBody(target, target.PlayerId); 105 | bodiesCreated[target.PlayerId]++; 106 | 107 | Coroutines.Start(CoNotify($"Bodies created: {bodiesCreated[target.PlayerId]}/2")); 108 | 109 | if (bodiesCreated[target.PlayerId] >= 2) 110 | { 111 | Utils.MissionSuccess(target, PlayerControl.LocalPlayer); 112 | yield break; 113 | } 114 | } 115 | } 116 | } 117 | 118 | public static IEnumerator UseEnergyThiefAbilities(PlayerControl target) 119 | { 120 | float drainRange = 3.5f; 121 | 122 | if (!drainCount.ContainsKey(target.PlayerId)) 123 | { 124 | drainCount[target.PlayerId] = 0; 125 | } 126 | while (true) 127 | { 128 | if (target.Data.IsDead) 129 | { 130 | Utils.MissionFails(target, PlayerControl.LocalPlayer); 131 | yield break; 132 | } 133 | if (Input.GetKeyDown(KeyCode.F5)) 134 | { 135 | var playersInRange = Helpers.GetClosestPlayers( 136 | target, 137 | drainRange, 138 | ignoreColliders: true, 139 | ignoreSource: true 140 | ).Where(p => !p.Data.IsDead && !p.Data.Disconnected && p != PlayerControl.LocalPlayer).ToList(); 141 | 142 | if (playersInRange.Count > 0) 143 | { 144 | var victim = playersInRange[0]; 145 | 146 | Utils.RpcRandomDrainActions(target, victim); 147 | drainCount[target.PlayerId]++; 148 | if (target.AmOwner) 149 | { 150 | Coroutines.Start(CoNotify($"You have drained energy from {victim.Data.PlayerName}!")); 151 | } 152 | if (victim.AmOwner) 153 | { 154 | Coroutines.Start(CoNotify("Your energy has been drained!")); 155 | } 156 | 157 | if (drainCount[target.PlayerId] >= 2) 158 | { 159 | Utils.MissionSuccess(target, PlayerControl.LocalPlayer); 160 | yield break; 161 | } 162 | } 163 | else 164 | { 165 | if (target.AmOwner) 166 | { 167 | Coroutines.Start(CoNotify("No players nearby to drain energy from.")); 168 | } 169 | } 170 | } 171 | } 172 | } 173 | public static IEnumerator CoReviveAndKill(PlayerControl target) 174 | { 175 | bool revived = false; 176 | byte revivedParentId = 255; 177 | 178 | Coroutines.Start(CoNotify("Press F5 to revive a dead player!")); 179 | 180 | while (true) 181 | { 182 | if (target.Data.IsDead) 183 | { 184 | Utils.MissionFails(target, PlayerControl.LocalPlayer); 185 | yield break; 186 | } 187 | if (Input.GetKeyDown(KeyCode.F5)) 188 | { 189 | if (!revived) 190 | { 191 | var deadBody = Utils.GetClosestBody(); 192 | if (deadBody == null) 193 | { 194 | Coroutines.Start(CoNotify("No dead body found! Move closer and press F5 again.")); 195 | } 196 | else 197 | { 198 | revivedParentId = deadBody.ParentId; 199 | 200 | Utils.RpcRevive(deadBody); 201 | 202 | yield return new WaitForSeconds(0.5f); 203 | 204 | Coroutines.Start(CoNotify("Player revived! Press F5 to kill them again!")); 205 | 206 | revived = true; 207 | } 208 | } 209 | else 210 | { 211 | var revivedData = GameData.Instance.GetPlayerById(revivedParentId); 212 | if (revivedData != null && revivedData.Object != null && !revivedData.Object.Data.IsDead) 213 | { 214 | PlayerControl.LocalPlayer.RpcCustomMurder(revivedData.Object, createDeadBody: true, didSucceed: true, showKillAnim: false, playKillSound: true, teleportMurderer:false); 215 | Utils.MissionSuccess(target, PlayerControl.LocalPlayer); 216 | yield break; 217 | } 218 | } 219 | } 220 | yield return null; 221 | } 222 | } 223 | public static IEnumerator CoHandleWantedTarget(ArrowBehaviour arrow, PlayerControl mostwantedTarget, PlayerControl target) 224 | { 225 | while (!mostwantedTarget.Data.IsDead && !mostwantedTarget.Data.Disconnected) 226 | { 227 | arrow.target = mostwantedTarget.transform.position; 228 | yield return null; 229 | } 230 | Object.Destroy(arrow.gameObject); 231 | 232 | yield return new WaitForSeconds(0.5f); 233 | 234 | var killer = Utils.GetKiller(mostwantedTarget); 235 | if (killer != null && killer == target) 236 | { 237 | Utils.MissionSuccess(target, PlayerControl.LocalPlayer); 238 | } 239 | else 240 | { 241 | Utils.MissionFails(target, PlayerControl.LocalPlayer); 242 | } 243 | yield break; 244 | } 245 | } 246 | } 247 | -------------------------------------------------------------------------------- /NewMod/Utilities/PranksterUtilities.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEngine; 3 | using System.Collections.Generic; 4 | using Reactor.Networking.Attributes; 5 | 6 | namespace NewMod.Utilities 7 | { 8 | public static class PranksterUtilities 9 | { 10 | // The name assigned to the prankster clone body 11 | private const string PranksterBodyName = "PranksterCloneBody"; 12 | 13 | // Dictionary tracking how many times each player has reported a Prankster body 14 | private static readonly Dictionary ReportCounts = new(); 15 | 16 | /// 17 | /// Creates a "prankster clone" dead body at the local player's position. 18 | /// 19 | [MethodRpc((uint)CustomRPC.FakeBody, LocalHandling = Reactor.Networking.Rpc.RpcLocalHandling.After)] 20 | public static void CreatePranksterDeadBody(PlayerControl player, byte parentId) 21 | { 22 | var deadBody = Object.Instantiate(GameManager.Instance.DeadBodyPrefab); 23 | deadBody.name = PranksterBodyName; 24 | deadBody.ParentId = parentId; 25 | // Shuffle the player colors 26 | var shuffledColors = Utils.ShuffleArrays(Palette.PlayerColors.ToArray()); 27 | 28 | for (int i = 0; i < deadBody.bodyRenderers.Length; i++) 29 | { 30 | deadBody.bodyRenderers[i].color = shuffledColors[i % shuffledColors.Length]; 31 | } 32 | deadBody.transform.position = player.GetTruePosition(); 33 | } 34 | 35 | /// 36 | /// Checks if the given DeadBody object is a prankster clone body. 37 | /// 38 | /// The DeadBody object to check. 39 | /// True if the body is a prankster clone body; otherwise, false. 40 | public static bool IsPranksterBody(DeadBody body) 41 | { 42 | return body.name.Equals(PranksterBodyName, System.StringComparison.OrdinalIgnoreCase); 43 | } 44 | /// 45 | /// Finds all prankster clone bodies currently in the game scene. 46 | /// 47 | /// A list of DeadBody objects representing all prankster clone bodies found. 48 | public static List FindAllPranksterBodies() 49 | { 50 | var allDeadBodies = Object.FindObjectsOfType(); 51 | var pranksterBodies = new List(); 52 | 53 | foreach (var body in allDeadBodies) 54 | { 55 | if (IsPranksterBody(body)) 56 | { 57 | pranksterBodies.Add(body); 58 | } 59 | } 60 | return pranksterBodies; 61 | } 62 | 63 | /// 64 | /// Increments the report count for a specified player when they report a prankster body. 65 | /// 66 | /// The ID of the player reporting the body. 67 | public static void IncrementReportCount(byte playerId) 68 | { 69 | ReportCounts[playerId] = GetReportCount(playerId) + 1; 70 | } 71 | 72 | /// 73 | /// Clears all recorded report counts for prankster bodies. 74 | /// 75 | public static void ResetReportCount() 76 | { 77 | ReportCounts.Clear(); 78 | } 79 | 80 | /// 81 | /// Retrieves the number of times the specified player has reported a prankster body. 82 | /// 83 | /// The ID of the player. 84 | /// The report count for the player, or 0 if the player has not reported a prankster body. 85 | public static int GetReportCount(byte playerId) 86 | { 87 | return ReportCounts.TryGetValue(playerId, out int value) ? value : 0; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /NewMod/Utilities/Utils.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using Hazel; 4 | using Reactor.Networking.Attributes; 5 | using UnityEngine; 6 | using Reactor.Utilities; 7 | using AmongUs.GameOptions; 8 | using MiraAPI.Networking; 9 | using NewMod.Roles.NeutralRoles; 10 | using MiraAPI.Roles; 11 | using System.Collections; 12 | 13 | namespace NewMod.Utilities 14 | { 15 | public static class Utils 16 | { 17 | public static Dictionary EnergyThiefDrainCounts = new Dictionary(); 18 | public static Dictionary PlayerKiller = new Dictionary(); 19 | public static Dictionary MissionSuccessCount = new Dictionary(); 20 | public static Dictionary MissionFailureCount = new Dictionary(); 21 | public static HashSet waitingPlayers = new(); 22 | public static Dictionary> savedPlayerRoles = new Dictionary>(); 23 | public static Dictionary MissionTimer = new Dictionary(); 24 | 25 | /// 26 | /// Retrieves a PlayerControl instance by its player ID. 27 | /// 28 | /// The player's ID. 29 | /// The PlayerControl object or null if not found. 30 | // Thanks to: https://github.com/eDonnes124/Town-Of-Us-R/blob/master/source/Patches/Utils.cs#L219 31 | public static PlayerControl PlayerById(byte id) 32 | { 33 | foreach (var player in PlayerControl.AllPlayerControls) 34 | if (player.PlayerId == id) 35 | return player; 36 | 37 | return null; 38 | } 39 | /// 40 | /// Records a kill event by mapping a victim to its killer. 41 | /// 42 | /// The player who performed the kill. 43 | /// The player who was killed. 44 | public static void RecordOnKill(PlayerControl killer, PlayerControl victim) 45 | { 46 | if (PlayerKiller.ContainsKey(killer)) 47 | { 48 | PlayerKiller[victim] = killer; 49 | } 50 | else 51 | { 52 | PlayerKiller.Add(victim, killer); 53 | } 54 | } 55 | 56 | /// 57 | /// Retrieves the killer of the specified victim. 58 | /// 59 | /// The player who was killed. 60 | /// The player who killed the victim, or null if not found. 61 | public static PlayerControl GetKiller(PlayerControl victim) 62 | { 63 | return PlayerKiller.TryGetValue(victim, out var killer) ? killer : null; 64 | } 65 | /// 66 | /// Finds the closest dead body to the local player within their kill distance. 67 | /// 68 | /// The closest DeadBody instance, or null if none are found. 69 | public static DeadBody GetClosestBody() 70 | { 71 | var allocs = Physics2D.OverlapCircleAll( 72 | PlayerControl.LocalPlayer.GetTruePosition(), 73 | GameOptionsManager.Instance.currentNormalGameOptions.KillDistance, 74 | Constants.PlayersOnlyMask 75 | ); 76 | 77 | DeadBody closestBody = null; 78 | var closestDistance = float.MaxValue; 79 | 80 | foreach (var collider2D in allocs) 81 | { 82 | if (PlayerControl.LocalPlayer.Data.IsDead || collider2D.tag != "DeadBody") continue; 83 | 84 | var component = collider2D.GetComponent(); 85 | var distance = Vector2.Distance(PlayerControl.LocalPlayer.GetTruePosition(), component.TruePosition); 86 | 87 | if (distance <= GameOptionsManager.Instance.currentNormalGameOptions.KillDistance && distance < closestDistance) 88 | { 89 | closestBody = component; 90 | closestDistance = distance; 91 | } 92 | } 93 | return closestBody; 94 | } 95 | // Inspired By : https://github.com/eDonnes124/Town-Of-Us-R/blob/master/source/Patches/CrewmateRoles/AltruistMod/Coroutine.cs#L57 96 | public static void Revive(DeadBody body) 97 | { 98 | if (body == null) return; 99 | 100 | var parentId = body.ParentId; 101 | var player = PlayerById(parentId); 102 | 103 | if (player != null) 104 | { 105 | foreach (var deadBody in GameObject.FindObjectsOfType()) 106 | { 107 | if (deadBody.ParentId == body.ParentId) 108 | Object.Destroy(deadBody.gameObject); 109 | } 110 | 111 | player.Revive(); 112 | if (player.Data.Role is NoisemakerRole role) 113 | { 114 | Object.Destroy(role.deathArrowPrefab.gameObject); 115 | } 116 | player.RpcSetRole(AmongUs.GameOptions.RoleTypes.Impostor, true); 117 | } 118 | } 119 | 120 | // Thanks to: https://github.com/Rabek009/MoreGamemodes/blob/master/Modules/Utils.cs#L66 121 | /// 122 | /// Checks if a particular system type is active on the current map. 123 | /// 124 | /// The SystemTypes to check. 125 | /// True if the system type is active, otherwise false. 126 | public static bool IsActive(SystemTypes type) 127 | { 128 | int mapId = GameOptionsManager.Instance.CurrentGameOptions.MapId; 129 | 130 | if (!ShipStatus.Instance.Systems.ContainsKey(type)) 131 | { 132 | return false; 133 | } 134 | switch (type) 135 | { 136 | case SystemTypes.Electrical: 137 | if (mapId == 5) return false; 138 | var SwitchSystem = ShipStatus.Instance.Systems[type].TryCast(); 139 | return SwitchSystem != null && SwitchSystem.IsActive; 140 | case SystemTypes.Reactor: 141 | if (mapId == 2) return false; 142 | else 143 | { 144 | var ReactorSystemType = ShipStatus.Instance.Systems[type].TryCast(); 145 | return ReactorSystemType != null && ReactorSystemType.IsActive; 146 | } 147 | case SystemTypes.Laboratory: 148 | if (mapId != 2) return false; 149 | var ReactorSystemType2 = ShipStatus.Instance.Systems[type].TryCast(); 150 | return ReactorSystemType2 != null && ReactorSystemType2.IsActive; 151 | case SystemTypes.LifeSupp: 152 | if (mapId is 2 or 4 or 5) return false; 153 | var LifeSuppSystemType = ShipStatus.Instance.Systems[type].TryCast(); 154 | return LifeSuppSystemType != null && LifeSuppSystemType.IsActive; 155 | case SystemTypes.HeliSabotage: 156 | if (mapId != 4) return false; 157 | var HeliSabotageSystem = ShipStatus.Instance.Systems[type].TryCast(); 158 | return HeliSabotageSystem != null && HeliSabotageSystem.IsActive; 159 | case SystemTypes.Comms: 160 | if (mapId is 1 or 5) 161 | { 162 | var HqHudSystemType = ShipStatus.Instance.Systems[type].TryCast(); 163 | return HqHudSystemType != null && HqHudSystemType.IsActive; 164 | } 165 | else 166 | { 167 | var HudOverrideSystemType = ShipStatus.Instance.Systems[type].TryCast(); 168 | return HudOverrideSystemType != null && HudOverrideSystemType.IsActive; 169 | } 170 | case SystemTypes.MushroomMixupSabotage: 171 | if (mapId != 5) return false; 172 | var MushroomMixupSabotageSystem = ShipStatus.Instance.Systems[type].TryCast(); 173 | return MushroomMixupSabotageSystem != null && MushroomMixupSabotageSystem.IsActive; 174 | default: 175 | return false; 176 | } 177 | } 178 | // Thanks to : https://github.com/Rabek009/MoreGamemodes/blob/master/Modules/Utils.cs#L118 179 | /// 180 | /// Checks if any sabotage system is currently active. 181 | /// 182 | /// True if a sabotage system is active, otherwise false. 183 | public static bool IsSabotage() 184 | { 185 | return IsActive(SystemTypes.LifeSupp) || 186 | IsActive(SystemTypes.Reactor) || 187 | IsActive(SystemTypes.Laboratory) || 188 | IsActive(SystemTypes.Electrical) || 189 | IsActive(SystemTypes.Comms) || 190 | IsActive(SystemTypes.MushroomMixupSabotage) || 191 | IsActive(SystemTypes.HeliSabotage); 192 | } 193 | /// 194 | /// Records a drain count for the specified player. 195 | /// 196 | /// The player representing the energy thief. 197 | public static void RecordDrainCount(PlayerControl energyThief) 198 | { 199 | var playerId = energyThief.PlayerId; 200 | EnergyThiefDrainCounts[playerId] = GetDrainCount(playerId) + 1; 201 | NewMod.Instance.Log.LogInfo($"Player {playerId} drain count: {GetDrainCount(playerId)}"); 202 | } 203 | 204 | /// 205 | /// Retrieves the drain count for a specific player. 206 | /// 207 | /// The ID of the player. 208 | /// The drain count for the player. 209 | public static int GetDrainCount(byte playerId) 210 | { 211 | return EnergyThiefDrainCounts.TryGetValue(playerId, out var count) ? count : 0; 212 | } 213 | /// 214 | /// Resets all drain counts. 215 | /// 216 | public static void ResetDrainCount() 217 | { 218 | EnergyThiefDrainCounts.Clear(); 219 | } 220 | public static void RecordMissionSuccess(PlayerControl specialAgent) 221 | { 222 | var playerId = specialAgent.PlayerId; 223 | MissionSuccessCount[playerId] = GetMissionSuccessCount(playerId) + 1; 224 | } 225 | public static int GetMissionSuccessCount(byte playerId) 226 | { 227 | return MissionSuccessCount.TryGetValue(playerId, out var count) ? count : 0; 228 | } 229 | public static void ResetMissionSuccessCount() 230 | { 231 | MissionSuccessCount.Clear(); 232 | } 233 | public static void RecordMissionFailure(PlayerControl specialAgent) 234 | { 235 | var playerId = specialAgent.PlayerId; 236 | MissionFailureCount[playerId] = GetMissionFailureCount(playerId) + 1; 237 | } 238 | public static int GetMissionFailureCount(byte playerId) 239 | { 240 | return MissionFailureCount.TryGetValue(playerId, out var count) ? count : 0; 241 | } 242 | public static void ResetMissionFailureCount() 243 | { 244 | MissionFailureCount.Clear(); 245 | } 246 | /// 247 | /// Sends an RPC to revive a player from a dead body. 248 | /// 249 | /// The DeadBody instance to revive from. 250 | public static void RpcRevive(DeadBody body) 251 | { 252 | Revive(body); 253 | var writer = AmongUsClient.Instance.StartRpcImmediately( 254 | PlayerControl.LocalPlayer.NetId, 255 | (byte)CustomRPC.Revive, 256 | SendOption.Reliable 257 | ); 258 | writer.Write(PlayerControl.LocalPlayer.PlayerId); 259 | writer.Write(body.ParentId); 260 | AmongUsClient.Instance.FinishRpcImmediately(writer); 261 | } 262 | // Thanks to: https://github.com/yanpla/yanplaRoles/blob/master/Utils.cs#L55 263 | /// 264 | /// Records a player's role in their role history. 265 | /// 266 | /// The ID of the player 267 | /// The RoleBehaviour to save. 268 | public static void SavePlayerRole(byte playerId, RoleBehaviour role) 269 | { 270 | if (!savedPlayerRoles.ContainsKey(playerId)) 271 | { 272 | savedPlayerRoles[playerId] = new List(); 273 | } 274 | savedPlayerRoles[playerId].Add(role); 275 | } 276 | // Thanks to: https://github.com/yanpla/yanplaRoles/blob/master/Utils.cs#L64 277 | /// 278 | /// Retrieves the role history for a specific player. 279 | /// 280 | /// The ID of the player 281 | /// A list of RoleBehaviour representing the player's role history. 282 | public static List GetPlayerRolesHistory(byte playerId) 283 | { 284 | if (savedPlayerRoles.ContainsKey(playerId)) 285 | { 286 | return savedPlayerRoles[playerId]; 287 | } 288 | return new List(); 289 | } 290 | /// 291 | /// Retrieves a random player from the game who is alive and not disconnected. 292 | /// 293 | /// A random PlayerControl instance, or null if none are valid. 294 | public static PlayerControl GetRandomPlayer() 295 | { 296 | var players = PlayerControl.AllPlayerControls.ToArray().Where(p => !p.Data.IsDead && !p.Data.Disconnected).ToList(); 297 | 298 | if (players.Count > 0) 299 | { 300 | return players[Random.RandomRange(0, players.Count)]; 301 | } 302 | return null; 303 | } 304 | /// 305 | /// Performs a random draining action on a target player as part of a custom RPC. 306 | /// 307 | /// The player who initiates the drain. 308 | /// The player who is the target of the drain. 309 | [MethodRpc((uint)CustomRPC.Drain)] 310 | public static void RpcRandomDrainActions(PlayerControl source, PlayerControl target) 311 | { 312 | List actions = new List 313 | { 314 | () => 315 | { 316 | target.MyPhysics.Speed *= 0.5f; 317 | if (source.AmOwner) 318 | { 319 | HudManager.Instance.ShowPopUp($"{target.Data.PlayerName} speed was reduced by 50%!"); 320 | } 321 | }, 322 | () => 323 | { 324 | if (target.AmOwner) 325 | { 326 | HudManager.Instance.StartCoroutine(HudManager.Instance.CoFadeFullScreen(Color.black, Color.black, 0.5f, false)); 327 | target.NetTransform.Halt(); 328 | } 329 | if (source.AmOwner) 330 | { 331 | HudManager.Instance.ShowPopUp($"Movement is disabled for {target.Data.PlayerName}, and their screen is black!"); 332 | } 333 | }, 334 | () => 335 | { 336 | target.myTasks.Clear(); 337 | if (source.AmOwner) 338 | { 339 | HudManager.Instance.ShowPopUp($"{target.Data.PlayerName} had all of their tasks cleared!"); 340 | } 341 | }, 342 | () => 343 | { 344 | target.RemainingEmergencies = 0; 345 | if (source.AmOwner) 346 | { 347 | HudManager.Instance.ShowPopUp($"{target.Data.PlayerName} can no longer call emergency meetings!"); 348 | } 349 | }, 350 | () => 351 | { 352 | var randomPlayer = GetRandomPlayer(); 353 | if (randomPlayer != null) 354 | { 355 | target.NetTransform.RpcSnapTo(randomPlayer.GetTruePosition()); 356 | if (source.AmOwner) 357 | { 358 | HudManager.Instance.ShowPopUp($"{target.Data.PlayerName} has been teleported!"); 359 | } 360 | } 361 | } 362 | }; 363 | 364 | int randomIndex = Random.Range(0, actions.Count); 365 | actions[randomIndex].Invoke(); 366 | } 367 | public static string GetMission(PlayerControl target, MissionType mission) 368 | { 369 | var mostwantedTarget = GetRandomPlayer(); 370 | 371 | string selectedMission = mission switch 372 | { 373 | MissionType.KillMostWanted => $"Kill the Most Wanted Target: {mostwantedTarget.Data.PlayerName}", 374 | MissionType.DrainEnergy => "Drain one player using Energy Thief abilities", 375 | MissionType.CreateFakeBodies => "Disguise yourself as a random player and create fake dead bodies around the map using Prankster abilities!", 376 | MissionType.ReviveAndKill => "Revive a dead player using Necromancer powers and kill them again", 377 | _ => "Unknown mission." 378 | }; 379 | switch (mission) 380 | { 381 | case MissionType.KillMostWanted: 382 | // Set up arrow for most wanted target 383 | var gameObj = new GameObject(); 384 | var arrow = gameObj.AddComponent(); 385 | gameObj.transform.parent = mostwantedTarget.gameObject.transform; 386 | gameObj.layer = 5; 387 | var renderer = gameObj.AddComponent(); 388 | renderer.sprite = NewModAsset.Arrow.LoadAsset(); 389 | arrow.target = mostwantedTarget.transform.position; 390 | arrow.image = renderer; 391 | 392 | // Save the current role of the target 393 | SavePlayerRole(target.PlayerId, target.Data.Role); 394 | 395 | if (!target.Data.Role.IsImpostor) 396 | { 397 | target.RpcSetRole(RoleTypes.Impostor, true); 398 | } 399 | Coroutines.Start(CoroutinesHelper.CoHandleWantedTarget(arrow, mostwantedTarget, target)); 400 | 401 | var rolesHistory = GetPlayerRolesHistory(target.PlayerId); 402 | if (rolesHistory.Count > 0) 403 | { 404 | var lastIndex = rolesHistory.Count - 1; 405 | var originalRole = rolesHistory[lastIndex]; 406 | rolesHistory.RemoveAt(lastIndex); 407 | target.RpcSetRole(originalRole.Role, true); 408 | } 409 | break; 410 | 411 | case MissionType.CreateFakeBodies: 412 | // Disguise as a random player 413 | var randPlayer = GetRandomPlayer(); 414 | target.RpcShapeshift(randPlayer, false); 415 | 416 | if (target.AmOwner) 417 | { 418 | Coroutines.Start(CoroutinesHelper.CoNotify("Press F5 to Create Dead Bodies")); 419 | } 420 | Coroutines.Start(CoroutinesHelper.UsePranksterAbilities(target)); 421 | break; 422 | 423 | case MissionType.DrainEnergy: 424 | 425 | if (target.AmOwner) 426 | { 427 | Coroutines.Start(CoroutinesHelper.CoNotify("Press F5 to drain nearby players'energy")); 428 | } 429 | Coroutines.Start(CoroutinesHelper.UseEnergyThiefAbilities(target)); 430 | break; 431 | 432 | case MissionType.ReviveAndKill: 433 | 434 | Coroutines.Start(CoroutinesHelper.CoReviveAndKill(target)); 435 | break; 436 | } 437 | return selectedMission; 438 | } 439 | public static void MissionSuccess(PlayerControl target, PlayerControl specialAgent) 440 | { 441 | RecordMissionSuccess(specialAgent); 442 | 443 | if (specialAgent.AmOwner) 444 | { 445 | int currentSuccessCount = GetMissionSuccessCount(specialAgent.PlayerId); 446 | int netScore = currentSuccessCount - GetMissionFailureCount(specialAgent.PlayerId); 447 | Coroutines.Start(CoroutinesHelper.CoNotify($"Target {target.Data.PlayerName} has completed their mission!\nCurrent net score: {netScore}/3")); 448 | } 449 | else 450 | { 451 | Coroutines.Start(CoroutinesHelper.CoNotify("Mission Completed! You are free to go!")); 452 | } 453 | if (savedTasks.ContainsKey(target)) 454 | { 455 | target.myTasks = savedTasks[target]; 456 | savedTasks.Remove(target); 457 | } 458 | if (SpecialAgent.AssignedPlayer = target) 459 | { 460 | SpecialAgent.AssignedPlayer = null; 461 | } 462 | } 463 | public static void MissionFails(PlayerControl target, PlayerControl specialAgent) 464 | { 465 | RecordMissionFailure(specialAgent); 466 | 467 | if (specialAgent.AmOwner) 468 | { 469 | int currentFailureCount = GetMissionFailureCount(specialAgent.PlayerId); 470 | int netScore = GetMissionSuccessCount(specialAgent.PlayerId) - currentFailureCount; 471 | Coroutines.Start(CoroutinesHelper.CoNotify($"Target {target.Data.PlayerName} has failed their mission! Current net score: {netScore}/3")); 472 | } 473 | else 474 | { 475 | Coroutines.Start(CoroutinesHelper.CoNotify("Mission Failed! You will face the consequences!")); 476 | } 477 | specialAgent.RpcCustomMurder(target, createDeadBody:false, didSucceed:true, showKillAnim:false, playKillSound:true, teleportMurderer:false); 478 | 479 | if (savedTasks.ContainsKey(target)) 480 | { 481 | target.myTasks = savedTasks[target]; 482 | savedTasks.Remove(target); 483 | } 484 | if (SpecialAgent.AssignedPlayer = target) 485 | { 486 | SpecialAgent.AssignedPlayer = null; 487 | } 488 | } 489 | public static Il2CppSystem.Collections.Generic.Dictionary> savedTasks = new(); 490 | 491 | [MethodRpc((uint)CustomRPC.AssignMission)] 492 | public static void AssignMission(PlayerControl target) 493 | { 494 | // Save the target's tasks 495 | if (!savedTasks.ContainsKey(target)) 496 | { 497 | var newTaskList = new Il2CppSystem.Collections.Generic.List(); 498 | 499 | foreach (var task in target.myTasks) 500 | { 501 | newTaskList.Add(task); 502 | } 503 | savedTasks[target] = newTaskList; 504 | } 505 | 506 | // Clear all assigned tasks for the specified target player 507 | target.myTasks.Clear(); 508 | 509 | // Get all values of the MissionType enum 510 | MissionType[] missions = (MissionType[])System.Enum.GetValues(typeof(MissionType)); 511 | // Pick a random mission 512 | MissionType randomMission = missions[Random.Range(0, missions.Length)]; 513 | 514 | // Add the mission message to the player's tasks 515 | ImportantTextTask Missionmessage = new GameObject("MissionMessage").AddComponent(); 516 | Missionmessage.transform.SetParent(AmongUsClient.Instance.transform, false); 517 | Missionmessage.Text = $"Special Agent has given you a mission!\n" + 518 | $"Mission: {GetMission(target, randomMission)}\n" + 519 | $"Complete it or face the consequences!"; 520 | 521 | target.myTasks.Insert(0, Missionmessage); 522 | 523 | Coroutines.Start(CoroutinesHelper.CoMissionTimer(target, 60f)); 524 | } 525 | public static Color32[] ShuffleArrays(Color32[] array) 526 | { 527 | Color32[] shuffled = array.Clone() as Color32[]; 528 | for (int i = shuffled.Length - 1; i > 0; i--) 529 | { 530 | int j = Random.Range(0, i + 1); 531 | (shuffled[i], shuffled[j]) = (shuffled[j], shuffled[i]); 532 | } 533 | return shuffled; 534 | } 535 | public static IEnumerator CaptureScreenshot(string filePath) 536 | { 537 | string timestamp = System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); 538 | 539 | HudManager.Instance.SetHudActive(PlayerControl.LocalPlayer, PlayerControl.LocalPlayer.Data.Role, false); 540 | ScreenCapture.CaptureScreenshot(filePath, 4); 541 | VisionaryUtilities.CapturedScreenshotPaths.Add(filePath); 542 | NewMod.Instance.Log.LogInfo($"Capturing screenshot at {System.IO.Path.GetFileName(filePath)}."); 543 | 544 | yield return new WaitForSeconds(0.2f); 545 | 546 | HudManager.Instance.SetHudActive(PlayerControl.LocalPlayer, PlayerControl.LocalPlayer.Data.Role, true); 547 | } 548 | } 549 | } 550 | -------------------------------------------------------------------------------- /NewMod/Utilities/VisionaryUtilities.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Collections; 5 | using UnityEngine; 6 | using Object = UnityEngine.Object; 7 | using UnityEngine.UI; 8 | using TMPro; 9 | 10 | namespace NewMod.Utilities 11 | { 12 | public static class VisionaryUtilities 13 | { 14 | public static List CapturedScreenshotPaths = new(); 15 | 16 | /// 17 | /// Gets the directory where Visionary screenshots are stored. If the directory does not exist, it is created. 18 | /// 19 | public static string ScreenshotDirectory 20 | { 21 | get 22 | { 23 | string directory = Path.Combine(BepInEx.Paths.GameRootPath, "NewMod", "Screenshots"); 24 | if (!Directory.Exists(directory)) 25 | { 26 | Directory.CreateDirectory(directory); 27 | } 28 | return directory; 29 | } 30 | } 31 | 32 | /// 33 | /// Displays the most recent screenshot to the Visionary for a specified duration. 34 | /// 35 | /// The duration, in seconds, to display the screenshot. 36 | /// An IEnumerator that retrieves the latest screenshot. 37 | public static IEnumerator ShowScreenshots(float displayDuration) 38 | { 39 | string[] files = Directory.GetFiles(ScreenshotDirectory, "screenshot_*.png"); 40 | if (files.Length == 0) yield break; 41 | 42 | Array.Sort(files); 43 | string latestScreenshot = files[files.Length - 1]; 44 | NewMod.Instance.Log.LogInfo($"Displaying the latest screenshot: {latestScreenshot}"); 45 | 46 | while (!File.Exists(latestScreenshot)) 47 | { 48 | yield return null; 49 | } 50 | 51 | byte[] data = File.ReadAllBytes(latestScreenshot); 52 | Texture2D tex = new Texture2D(2, 2); 53 | tex.LoadImage(data); 54 | Sprite screenshotSprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f)); 55 | 56 | var screenshotPanel = new GameObject("Visionary_ScreenshotPanel"); 57 | var canvas = screenshotPanel.AddComponent(); 58 | canvas.renderMode = RenderMode.ScreenSpaceOverlay; 59 | 60 | var group = screenshotPanel.AddComponent(); 61 | group.alpha = 0; 62 | 63 | var imageObj = new GameObject("ScreenshotImage"); 64 | imageObj.transform.SetParent(screenshotPanel.transform, false); 65 | var image = imageObj.AddComponent(); 66 | image.sprite = screenshotSprite; 67 | image.preserveAspect = true; 68 | 69 | var rt = imageObj.GetComponent(); 70 | rt.sizeDelta = new Vector2(800, 600); 71 | rt.anchorMin = rt.anchorMax = rt.pivot = new Vector2(0.5f, 0.5f); 72 | rt.anchoredPosition = Vector2.zero; 73 | 74 | var bgObj = new GameObject("BorderOnBG"); 75 | bgObj.transform.SetParent(screenshotPanel.transform, false); 76 | var bjImage = bgObj.AddComponent(); 77 | bjImage.color = new Color(0f, 0f, 0f, 0.6f); 78 | 79 | var bgRT = bgObj.GetComponent(); 80 | bgRT.anchorMin = bgRT.anchorMax = bgRT.pivot = new Vector2(0.5f, 0.5f); 81 | bgRT.sizeDelta = new Vector2(810, 610); 82 | bgRT.anchoredPosition = Vector2.zero; 83 | bgObj.transform.SetAsFirstSibling(); 84 | 85 | var labelObj = new GameObject("Screenshot Label"); 86 | labelObj.transform.SetParent(screenshotPanel.transform, false); 87 | var label = labelObj.AddComponent(); 88 | label.alignment = TextAlignmentOptions.Center; 89 | label.fontSize = 20; 90 | 91 | DateTime captureTime = File.GetCreationTime(latestScreenshot); 92 | label.text = $"*Screenshot taken at: {captureTime.ToShortTimeString()}*"; 93 | 94 | var labelRT = labelObj.GetComponent(); 95 | labelRT.anchorMin = labelRT.anchorMax = labelRT.pivot = new Vector2(0.5f, 0.5f); 96 | labelRT.anchoredPosition = new Vector2(0, 380); 97 | labelRT.sizeDelta = new Vector2(800, 50); 98 | 99 | float fadeDuration = 1f; 100 | float elapsed = 0f; 101 | while (elapsed < fadeDuration) 102 | { 103 | elapsed += Time.deltaTime; 104 | float alpha = Mathf.Clamp01(elapsed / fadeDuration); 105 | group.alpha = alpha; 106 | yield return null; 107 | } 108 | group.alpha = 1f; 109 | 110 | yield return new WaitForSeconds(displayDuration); 111 | 112 | elapsed = 0f; 113 | while (elapsed < fadeDuration) 114 | { 115 | elapsed += Time.deltaTime; 116 | float alpha = 1f - Mathf.Clamp01(elapsed / fadeDuration); 117 | group.alpha = alpha; 118 | yield return null; 119 | } 120 | group.alpha = 0f; 121 | 122 | Object.Destroy(screenshotPanel); 123 | } 124 | 125 | /// 126 | /// Displays a screenshot from the given file path to the Visionary for a specified duration. 127 | /// 128 | /// The full file path of the screenshot to display. 129 | /// The duration, in seconds, to display the screenshot. 130 | /// An IEnumerator that handles fading the screenshot in and out. 131 | public static IEnumerator ShowScreenshotByPath(string filePath, float displayDuration) 132 | { 133 | if (!File.Exists(filePath)) yield break; 134 | 135 | byte[] data = File.ReadAllBytes(filePath); 136 | Texture2D tex = new Texture2D(2, 2); 137 | tex.LoadImage(data); 138 | Sprite screenshotSprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f)); 139 | 140 | var screenshotPanel = new GameObject("Visionary_ScreenshotPanel"); 141 | var canvas = screenshotPanel.AddComponent(); 142 | canvas.renderMode = RenderMode.ScreenSpaceOverlay; 143 | 144 | var group = screenshotPanel.AddComponent(); 145 | group.alpha = 0; 146 | 147 | var imageObj = new GameObject("ScreenshotImage"); 148 | imageObj.transform.SetParent(screenshotPanel.transform, false); 149 | var image = imageObj.AddComponent(); 150 | image.sprite = screenshotSprite; 151 | image.preserveAspect = true; 152 | 153 | var rt = imageObj.GetComponent(); 154 | rt.sizeDelta = new Vector2(800, 600); 155 | rt.anchorMin = rt.anchorMax = rt.pivot = new Vector2(0.5f, 0.5f); 156 | rt.anchoredPosition = Vector2.zero; 157 | 158 | var bgObj = new GameObject("BorderOnBG"); 159 | bgObj.transform.SetParent(screenshotPanel.transform, false); 160 | var bjImage = bgObj.AddComponent(); 161 | bjImage.color = new Color(0f, 0f, 0f, 0.6f); 162 | 163 | var bgRT = bgObj.GetComponent(); 164 | bgRT.anchorMin = bgRT.anchorMax = bgRT.pivot = new Vector2(0.5f, 0.5f); 165 | bgRT.sizeDelta = new Vector2(810, 610); 166 | bgRT.anchoredPosition = Vector2.zero; 167 | bgObj.transform.SetAsFirstSibling(); 168 | 169 | var labelObj = new GameObject("Screenshot Label"); 170 | labelObj.transform.SetParent(screenshotPanel.transform, false); 171 | var label = labelObj.AddComponent(); 172 | label.alignment = TextAlignmentOptions.Center; 173 | label.fontSize = 20; 174 | 175 | DateTime captureTime = File.GetCreationTime(filePath); 176 | label.text = $"*Screenshot taken at: {captureTime.ToShortTimeString()}*"; 177 | 178 | var labelRT = labelObj.GetComponent(); 179 | labelRT.anchorMin = labelRT.anchorMax = labelRT.pivot = new Vector2(0.5f, 0.5f); 180 | labelRT.anchoredPosition = new Vector2(0, 380); 181 | labelRT.sizeDelta = new Vector2(800, 50); 182 | 183 | float fadeDuration = 1f; 184 | float elapsed = 0f; 185 | while (elapsed < fadeDuration) 186 | { 187 | elapsed += Time.deltaTime; 188 | float alpha = Mathf.Clamp01(elapsed / fadeDuration); 189 | group.alpha = alpha; 190 | yield return null; 191 | } 192 | group.alpha = 1f; 193 | 194 | yield return new WaitForSeconds(displayDuration); 195 | 196 | elapsed = 0f; 197 | while (elapsed < fadeDuration) 198 | { 199 | elapsed += Time.deltaTime; 200 | float alpha = 1f - Mathf.Clamp01(elapsed / fadeDuration); 201 | group.alpha = alpha; 202 | yield return null; 203 | } 204 | group.alpha = 0f; 205 | 206 | Object.Destroy(screenshotPanel); 207 | } 208 | 209 | /// 210 | /// Deletes all screenshots from the Visionary screenshot directory. 211 | /// 212 | public static void DeleteAllScreenshots() 213 | { 214 | if (Directory.Exists(ScreenshotDirectory)) 215 | { 216 | foreach (string file in Directory.GetFiles(ScreenshotDirectory, "*.png")) 217 | { 218 | File.Delete(file); 219 | NewMod.Instance.Log.LogInfo($"Deleted screenshot: {file}"); 220 | } 221 | } 222 | } 223 | } 224 | } 225 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## NewMod Mod Documentation 2 |

3 | NewMod is a mod for Among Us that introduces a variety of new roles, unique abilities, and custom game modes, offering players exciting new ways to enjoy the game. 4 |

5 |

6 | 7 | GitHub stars 8 | 9 | 10 | GitHub forks 11 | 12 | 13 | License 14 | 15 |

16 | 17 | 18 | --- 19 | 20 | # 📑 Table Of Contents 21 | - [🚀 Releases](#-releases) 22 | - [📥 Installation](#-installation) 23 | - [✨ Features](#-features) 24 | - [🔗 Compatibility](#-compatibility) 25 | - [🤝 Contributing](#-contributing) 26 | - [👥 Credits](#-credits) 27 | - [⚠️ Disclaimer](#-disclaimer) 28 | 29 | --- 30 | 31 | # 🚀 Releases 32 | 33 | | Mod Version | Among Us - Version | Link | 34 | |-------------|---------------------|------| 35 | | v1.0.0 | 2024.8.13 & 2024.10.29 | [Download](https://github.com/CallOfCreator/NewMod/releases/download/v1.0.0/NewMod.dll) | 36 | | v1.1.0 | 2024.11.26 | [Download](https://github.com/CallOfCreator/NewMod/releases/download/V1.1.0/NewMod.dll) | 37 | 38 | --- 39 | 40 | # 📥 Installation 41 | 42 | 1. **Download the latest version of NewMod** for your Among Us installation from [here](https://github.com/CallOfCreator/NewMod/releases/latest). 43 | 2. Extract the contents into your Among Us folder. 44 | 3. Launch the game with `Among Us.exe`. The first run may take 4-5 minutes as the mod initializes. 45 | 46 | --- 47 | 48 | # ✨ Features 49 | 50 | ### **1. Crewmate Cam Access (F2)** 51 | - **🖥️ Description:** Allows crewmates to access security cameras from anywhere. 52 | - **👀 Strategic Use:** Monitor other players without needing to go to the security room. 53 | 54 | ### **2. Necromancer Role** 55 | - **🔮 Description:** A special Impostor role that can revive a dead player to join the Impostors. 56 | - **💨 Keybinds:** Press `F4` for teleport ability. 57 | 58 | ### **3. Revival Royale GameMode** *(currently unavailable)* 59 | - **⚔️ Description:** Every player is a Necromancer, competing to revive bodies. The first to reach a set number of revivals wins. 60 | 61 | ### **4. Energy Thief Role** 62 | - **💡 Description:** Drains energy from others, making them weaker. 63 | 64 | ### **5. Double Agent Role** 65 | - **🔍 Description:** Completes tasks but can sabotage neutrals and impostors after task completion. 66 | 67 | ### **6. Special Agent Role** 68 | - **🎖️ Description:** A neutral role that assigns missions to other players. 69 | - **📋 Mission Mechanics:** The assigned player must complete the mission or face penalties. 70 | - If the target fails the mission, the Special Agent loses a point toward their win condition. 71 | - **📹 Surveillance Option:** The Special Agent can monitor the target through a camera if enabled. 72 | - **🏆 Win Condition:** Successful mission completions contribute to the Special Agent’s victory. 73 | 74 | ### **7. Visionary Role** 75 | - **📸 Description:** A unique Crewmate role with the ability to take in-game screenshots to capture key moments like kills, venting, or suspicious activities. 76 | - **🖱️ How It Works:** 77 | - The Visionary can take multiple screenshots, but the limit depends on game settings. 78 | - If multiple screenshots are taken, the Visionary can open the in-game chat to see available screenshots (e.g., `/1`, `/2`) and select which one to display during a meeting. 79 | - **🧩 Strategy:** Use screenshots to catch impostors or prove innocence. 80 | 81 | --- 82 | 83 | # 🔗 Compatibility 84 | 85 | NewMod v1.1.0 is compatible with YanplaRoles, allowing for an enhanced experience with combined custom roles. Below is the supported version of YanplaRoles: 86 | 87 | | Mod Name | Mod Version | GitHub Link | 88 | |--------------|-------------|------------------------------------------------------| 89 | | YanplaRoles | v0.1.6+ | [Download](https://github.com/yanpla/yanplaRoles) | 90 | 91 | For more information on YanplaRoles, visit their official [GitHub page](https://github.com/yanpla/yanplaRoles). 92 | 93 | --- 94 | 95 | # 🤝 Contributing 96 | 97 | If you’d like to contribute, feel free to join and improve the project! 98 | 99 | --- 100 | 101 | # 👥 Credits 102 | 103 | - **MiraAPI**: [MiraAPI GitHub](https://github.com/Alll-Of-Us-Mods/MiraAPI) - Among Us modding API and utility library, with inspiration for the debug window and the derivation of the gold color from MiraAPIExample Mod. 104 | - **Reactor**: [Reactor GitHub](https://github.com/NuclearPowered/Reactor) - Modding API for Among Us. 105 | - **TownOfUs-R**: - Portions of code (PlayerById, GetClosestBody) and asset (ReviveSprite) derived from [Town-Of-Us-R](https://github.com/eDonnes124/Town-Of-Us-R). 106 | - **MoreGamemodes**: [MoreGamemodes](https://github.com/Rabek009/MoreGamemodes) - Derivation of IsActive and IsSabotage code. 107 | - **yanplaRoles**: [yanplaRoles](https://github.com/yanpla/yanplaRoles) - Portions of code (SavePlayerRole, GetPlayerRolesHistory). 108 | 109 | --- 110 | 111 | # ⚠️ Disclaimer 112 | 113 | NewMod is not affiliated with Among Us or Innersloth LLC, and the content contained herein is not endorsed or otherwise sponsored by Innersloth LLC. Portions of the materials contained herein are property of Innersloth LLC. © Innersloth LLC. 114 | 115 | --- 116 | 117 | Enjoy an enhanced Among Us experience with NewMod! 118 | -------------------------------------------------------------------------------- /nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | --------------------------------------------------------------------------------