code
stringlengths 0
56.1M
| repo_name
stringlengths 3
57
| path
stringlengths 2
176
| language
stringclasses 672
values | license
stringclasses 8
values | size
int64 0
56.8M
|
|---|---|---|---|---|---|
#version 450
layout (location = 0) out vec3 fragColor;
vec2 positions[3] = vec2[](
vec2(-1.0, 1.0),
vec2( 0.0, -1.0),
vec2( 1.0, 1.0)
);
vec3 colors[3] = vec3[](
vec3(1.0, 0.0, 0.0),
vec3(0.0, 1.0, 0.0),
vec3(0.0, 0.0, 1.0)
);
void main() {
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
//texCoord = positions[gl_VertexIndex].xy * 0.5 + vec2(0.5);
fragColor = colors[gl_VertexIndex];
}
|
whupdup/frame
|
shaders/simple_tri.vert
|
GLSL
|
gpl-3.0
| 413
|
#version 450
layout (local_size_x = 256) in;
layout (push_constant) uniform PushConstants {
uint drawCount;
} constants;
struct InstanceIndices {
uint objectIndex;
uint meshIndex;
};
struct DrawCommand {
uint indexCount;
uint instanceCount;
uint firstIndex;
int vertexOffset;
uint firstInstance;
};
layout (set = 0, binding = 0) buffer IndirectCommandBuffer {
DrawCommand commands[];
};
layout (set = 0, binding = 1) buffer InInstanceIndexBuffer {
InstanceIndices inInstanceIndices[];
};
layout (set = 0, binding = 2) buffer OutInstanceIndexBuffer {
uint outInstanceIndices[];
};
void main() {
uint gID = gl_GlobalInvocationID.x;
if (gID < constants.drawCount) {
uint meshIndex = inInstanceIndices[gID].meshIndex;
uint instIndex = atomicAdd(commands[meshIndex].instanceCount, 1);
outInstanceIndices[instIndex] = inInstanceIndices[gID].objectIndex;
}
}
|
whupdup/frame
|
shaders/static_mesh_cull.comp
|
GLSL
|
gpl-3.0
| 882
|
#version 450
layout (location = 0) in vec2 texCoord;
layout (location = 0) out vec4 outColor;
layout (set = 0, binding = 0) uniform sampler2D tex0;
void main() {
outColor = texture(tex0, texCoord);
}
|
whupdup/frame
|
shaders/textured_tri.frag
|
GLSL
|
gpl-3.0
| 206
|
#version 450
layout (location = 0) out vec2 texCoord;
vec2 positions[3] = vec2[](
vec2(-1.0, 1.0),
vec2( 0.0, -1.0),
vec2( 1.0, 1.0)
);
void main() {
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
texCoord = positions[gl_VertexIndex].xy * 0.5 + vec2(0.5);
}
|
whupdup/frame
|
shaders/textured_tri.vert
|
GLSL
|
gpl-3.0
| 279
|
#include <gtest/gtest.h>
#include <graphics/barrier_info_collection.hpp>
#include <graphics/buffer_resource_tracker.hpp>
#include <graphics/command_buffer.hpp>
using namespace ZN;
using namespace ZN::GFX;
TEST(BRTester, SingleInsertion) {
BarrierInfoCollection bic{};
BufferResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 0,
.size = 16,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
EXPECT_EQ(res.get_range_count(), 1);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 1);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0), 1);
}
TEST(BRTester, WriteAfterWriteSecondSmaller) {
BarrierInfoCollection bic{};
BufferResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 0,
.size = 16,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 1,
.size = 14,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
EXPECT_EQ(res.get_range_count(), 3);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 1);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
}
TEST(BRTester, WriteAfterWriteFirstSmaller) {
BarrierInfoCollection bic{};
BufferResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 1,
.size = 14,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 0,
.size = 16,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
EXPECT_EQ(res.get_range_count(), 1);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 2);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 2);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
}
TEST(BRTester, FirstPartialBeforeSecond) {
BarrierInfoCollection bic{};
BufferResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 0,
.size = 12,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 8,
.size = 16,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
EXPECT_EQ(res.get_range_count(), 2);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 2);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
}
TEST(BRTester, WriteAfterWriteSecondSmallerQFOT) {
BarrierInfoCollection bic{};
BufferResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 0,
.size = 16,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 1,
.size = 14,
.queueFamilyIndex = 2u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
EXPECT_EQ(res.get_range_count(), 1);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 1);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
}
TEST(BRTester, WriteAfterWriteFirstSmallerQFOT) {
BarrierInfoCollection bic{};
BufferResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 1,
.size = 14,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 0,
.size = 16,
.queueFamilyIndex = 2u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
bic.print_barriers();
EXPECT_EQ(res.get_range_count(), 1);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 2);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 2);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
}
TEST(BRTester, FirstPartialBeforeSecondQFOT) {
BarrierInfoCollection bic{};
BufferResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 0,
.size = 12,
.queueFamilyIndex = 1u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.offset = 8,
.size = 16,
.queueFamilyIndex = 2u,
}, BufferResourceTracker::BarrierMode::ALWAYS, false);
EXPECT_EQ(res.get_range_count(), 2);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 2);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_EQ(bic.get_buffer_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
}
|
whupdup/frame
|
src/br_tests.cpp
|
C++
|
gpl-3.0
| 6,666
|
#pragma once
#include <initializer_list>
namespace ZN {
template <typename T>
constexpr T max(std::initializer_list<T> iList) {
auto largest = iList.begin();
for (auto it = largest + 1, end = iList.end(); it != end; ++it) {
if (*it > *largest) {
largest = it;
}
}
return *largest;
}
}
|
whupdup/frame
|
src/core/algorithms.hpp
|
C++
|
gpl-3.0
| 303
|
#pragma once
#include <cstdint>
#include <cstddef>
namespace ZN {
enum class IterationDecision {
CONTINUE,
BREAK
};
}
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(_WIN64) || defined(WIN64)
#define OPERATING_SYSTEM_WINDOWS
#elif defined(__linux__)
#define OPERATING_SYSTEM_LINUX
#elif defined(__APPLE__)
#define OPERATING_SYSTEM_MACOS
#else
#define OPERATING_SYSTEM_OTHER
#endif
#if defined(__clang__)
#define COMPILER_CLANG
#elif defined(__GNUC__) || defined(__GNUG__)
#define COMPILER_GCC
#elif defined(_MSC_VER)
#define COMPILER_MSVC
#else
#define COMPILER_OTHER
#endif
#ifdef COMPILER_MSVC
#define ZN_FORCEINLINE __forceinline
#define ZN_NEVERINLINE __declspec(noinline)
#elif defined(COMPILER_CLANG) || defined(COMPILER_GCC)
#define ZN_FORCEINLINE inline __attribute__((always_inline))
#define ZN_NEVERINLINE __attribute__((noinline))
#else
#define ZN_FORCEINLINE inline
#define ZN_NEVERINLINE
#endif
#define CONCAT_LABEL_(prefix, suffix) prefix##suffix
#define CONCAT_LABEL(prefix, suffix) CONCAT_LABEL_(prefix, suffix)
#define MAKE_UNIQUE_VARIABLE_NAME(prefix) CONCAT(prefix##_, __LINE__)
#define NULL_COPY_AND_ASSIGN(ClassName) \
ClassName(const ClassName&) = delete; \
void operator=(const ClassName&) = delete; \
ClassName(ClassName&&) = delete; \
void operator=(ClassName&&) = delete
#define DEFAULT_COPY_AND_ASSIGN(ClassName) \
ClassName(const ClassName&) = default; \
ClassName& operator=(const ClassName&) = default; \
ClassName(ClassName&&) = default; \
ClassName& operator=(ClassName&&) = default
|
whupdup/frame
|
src/core/common.hpp
|
C++
|
gpl-3.0
| 1,605
|
#pragma once
#include <cstdint>
namespace ZN {
class HashBuilder {
public:
using Hash_T = uint64_t;
constexpr HashBuilder& add_uint32(uint32_t value) {
m_hash = static_cast<Hash_T>(m_hash * 0x100000001B3ull) ^ static_cast<Hash_T>(value);
return *this;
}
constexpr HashBuilder& add_int32(int32_t value) {
add_uint32(static_cast<uint32_t>(value));
return *this;
}
constexpr HashBuilder& add_float(float value) {
union {
float f;
uint32_t i;
} punnedValue;
punnedValue.f = value;
add_uint32(punnedValue.i);
return *this;
}
constexpr HashBuilder& add_uint64(uint64_t value) {
add_uint32(static_cast<uint32_t>(value & 0xFF'FF'FF'FFu));
add_uint32(static_cast<uint32_t>(value >> 32));
return *this;
}
constexpr HashBuilder& add_int64(int64_t value) {
add_uint64(static_cast<uint64_t>(value));
return *this;
}
template <typename T>
constexpr HashBuilder& add_pointer(T* value) {
add_uint64(static_cast<uint64_t>(reinterpret_cast<uintptr_t>(value)));
return *this;
}
constexpr HashBuilder& add_string(const char* str) {
add_uint32(0xFFu);
while (*str) {
add_uint32(static_cast<uint32_t>(*str));
++str;
}
return *this;
}
constexpr HashBuilder& add_string(const char* str, size_t size) {
add_uint32(0xFFu);
for (auto* end = str + size; str != end; ++str) {
add_uint32(static_cast<uint32_t>(*str));
}
return *this;
}
template <typename StringLike>
constexpr HashBuilder& add_string(const StringLike& str) {
add_uint32(0xFFu);
for (auto c : str) {
add_uint32(static_cast<uint32_t>(c));
}
return *this;
}
constexpr Hash_T get() const {
return m_hash;
}
private:
// FNV-11a magic number
Hash_T m_hash = 0xCBF29CE484222325ull;
};
}
|
whupdup/frame
|
src/core/hash_builder.hpp
|
C++
|
gpl-3.0
| 1,806
|
#pragma once
#include <core/common.hpp>
#include <atomic>
#include <memory>
#include <utility>
namespace ZN::Memory {
class SingleThreadCounter {
public:
void add_ref() {
++m_count;
}
bool release() {
--m_count;
return m_count == 0;
}
private:
size_t m_count = 1;
};
class MultiThreadCounter {
public:
MultiThreadCounter() {
m_count.store(1, std::memory_order_relaxed);
}
void add_ref() {
m_count.fetch_add(1, std::memory_order_relaxed);
}
bool release() {
auto result = m_count.fetch_sub(1, std::memory_order_acq_rel);
return result == 1;
}
private:
std::atomic_size_t m_count;
};
template <typename T>
class IntrusivePtr;
template <typename T, typename Deletor = std::default_delete<T>,
typename Counter = SingleThreadCounter>
class IntrusivePtrEnabled {
public:
using pointer_type = IntrusivePtr<T>;
using base_type = T;
using deletor_type = Deletor;
using counter_type = Counter;
explicit IntrusivePtrEnabled() = default;
NULL_COPY_AND_ASSIGN(IntrusivePtrEnabled);
void release_ref() {
if (m_counter.release()) {
Deletor{}(static_cast<T*>(this));
}
}
void add_ref() {
m_counter.add_ref();
}
IntrusivePtr<T> reference_from_this();
private:
Counter m_counter;
};
template <typename T>
class IntrusivePtr {
public:
template <typename U>
friend class IntrusivePtr;
IntrusivePtr() = default;
IntrusivePtr(std::nullptr_t)
: m_data(nullptr) {}
template <typename U>
explicit IntrusivePtr(U* handle)
: m_data(static_cast<T*>(handle)) {}
T& operator*() const noexcept {
return *m_data;
}
T* operator->() const noexcept {
return m_data;
}
explicit operator bool() const {
return m_data != nullptr;
}
bool operator==(const IntrusivePtr& other) const {
return m_data == other.m_data;
}
bool operator!=(const IntrusivePtr& other) const {
return m_data != other.m_data;
}
T* get() const noexcept {
return m_data;
}
void reset() {
using ReferenceBase = IntrusivePtrEnabled<typename T::base_type,
typename T::deletor_type, typename T::counter_type>;
if (m_data) {
static_cast<ReferenceBase*>(m_data)->release_ref();
}
m_data = nullptr;
}
template <typename U>
IntrusivePtr& operator=(const IntrusivePtr<U>& other) {
static_assert(std::is_base_of<T, U>::value,
"Cannot safely assign downcasted intrusive pointers");
using ReferenceBase = IntrusivePtrEnabled<typename T::base_type,
typename T::deletor_type, typename T::counter_type>;
reset();
m_data = static_cast<T*>(other.m_data);
if (m_data) {
static_cast<ReferenceBase*>(m_data)->add_ref();
}
return *this;
}
IntrusivePtr& operator=(const IntrusivePtr& other) {
using ReferenceBase = IntrusivePtrEnabled<typename T::base_type,
typename T::deletor_type, typename T::counter_type>;
if (this != &other) {
reset();
m_data = other.m_data;
if (m_data) {
static_cast<ReferenceBase*>(m_data)->add_ref();
}
}
return *this;
}
template <typename U>
IntrusivePtr(const IntrusivePtr<U>& other) {
*this = other;
}
IntrusivePtr(const IntrusivePtr& other) {
*this = other;
}
~IntrusivePtr() {
reset();
}
template <typename U>
IntrusivePtr& operator=(IntrusivePtr<U>&& other) noexcept {
reset();
m_data = other.m_data;
other.m_data = nullptr;
return *this;
}
IntrusivePtr& operator=(IntrusivePtr&& other) noexcept {
if (this != &other) {
reset();
m_data = other.m_data;
other.m_data = nullptr;
}
return *this;
}
template <typename U>
IntrusivePtr(IntrusivePtr<U>&& other) noexcept {
*this = std::move(other);
}
IntrusivePtr(IntrusivePtr&& other) noexcept {
*this = std::move(other);
}
template <typename U>
bool owner_before(const IntrusivePtr<U>& other) const noexcept {
return m_data < other.m_data;
}
template <typename U>
bool operator<(const IntrusivePtr<U>& other) const noexcept {
return owner_before(other);
}
private:
T* m_data = nullptr;
};
template <typename T, typename Deletor, typename Counter>
IntrusivePtr<T> IntrusivePtrEnabled<T, Deletor, Counter>::reference_from_this() {
add_ref();
return IntrusivePtr<T>(static_cast<T*>(this));
}
template <typename T, typename... Args>
inline IntrusivePtr<T> make_intrusive(Args&&... args) {
return IntrusivePtr<T>(new T(std::forward<Args>(args)...));
}
template <typename T, typename U, typename... Args>
inline typename T::pointer_type make_intrusive(Args&&... args) {
return typename T::pointer_type(new U(std::forward<Args>(args)...));
}
template <typename T, typename U>
inline Memory::IntrusivePtr<T> intrusive_pointer_cast(Memory::IntrusivePtr<U> p) {
using ReferenceBaseT = IntrusivePtrEnabled<typename T::base_type,
typename T::deletor_type, typename T::counter_type>;
using ReferenceBaseU = IntrusivePtrEnabled<typename U::base_type,
typename U::deletor_type, typename U::counter_type>;
static_assert(std::is_same_v<ReferenceBaseT, ReferenceBaseU>,
"Downcasting IntrusivePtr is only safe if they share the same reference base");
if (p) {
static_cast<ReferenceBaseU*>(p.get())->add_ref();
}
return Memory::IntrusivePtr<T>(static_cast<T*>(p.get()));
}
template <typename T>
using ThreadSafeIntrusivePtrEnabled = IntrusivePtrEnabled<T, std::default_delete<T>,
MultiThreadCounter>;
template <typename T>
IntrusivePtr(T*) -> IntrusivePtr<T>;
}
namespace std {
template <typename T>
struct hash<ZN::Memory::IntrusivePtr<T>> {
size_t operator()(const ZN::Memory::IntrusivePtr<T>& p) const {
return std::hash<T*>{}(p.get());
}
};
}
|
whupdup/frame
|
src/core/intrusive_ptr.hpp
|
C++
|
gpl-3.0
| 5,673
|
#pragma once
#include <cassert>
#include <cstdint>
#include <new>
#include <utility>
namespace ZN {
template <typename T>
class Local {
public:
Local() noexcept = default;
Local(const Local&) = delete;
void operator=(const Local&) = delete;
Local(Local&&) = delete;
void operator=(Local&&) = delete;
template <typename... Args>
void create(Args&&... args) noexcept {
assert(!ptr && "Local::create(): ptr must be null");
ptr = new (data) T(std::forward<Args>(args)...);
}
void destroy() noexcept {
assert(ptr && "Local::destroy(): ptr must not be null");
ptr->~T();
ptr = nullptr;
}
T& operator*() noexcept {
assert(ptr && "Local::operator*(): ptr must not be null");
return *ptr;
}
T* operator->() const noexcept {
assert(ptr && "Local::operator->(): ptr must not be null");
return ptr;
}
T* get() const noexcept {
return ptr;
}
operator bool() const noexcept {
return ptr != nullptr;
}
~Local() noexcept {
if (ptr) {
destroy();
}
}
private:
alignas(T) uint8_t data[sizeof(T)] = {};
T* ptr = nullptr;
};
}
|
whupdup/frame
|
src/core/local.hpp
|
C++
|
gpl-3.0
| 1,110
|
#pragma once
#include <memory>
namespace ZN::Memory {
using std::construct_at;
using std::uninitialized_move;
using std::uninitialized_move_n;
using std::uninitialized_copy;
using std::uninitialized_copy_n;
using std::uninitialized_default_construct;
using std::uninitialized_default_construct_n;
using std::destroy;
using std::destroy_at;
using std::destroy_n;
template <typename T>
using SharedPtr = std::shared_ptr<T>;
template <typename T>
using UniquePtr = std::unique_ptr<T>;
using std::static_pointer_cast;
}
|
whupdup/frame
|
src/core/memory.hpp
|
C++
|
gpl-3.0
| 524
|
#pragma once
namespace ZN {
template <typename K, typename V>
struct Pair {
K first;
V second;
};
template <typename K, typename V>
Pair(K, V) -> Pair<K, V>;
}
|
whupdup/frame
|
src/core/pair.hpp
|
C++
|
gpl-3.0
| 167
|
#pragma once
#include <cstddef>
#include <iterator>
namespace ZN {
template <typename T>
class Span {
public:
using value_type = T;
using size_type = size_t;
using difference_type = ptrdiff_t;
using reference = value_type&;
using const_reference = const value_type&;
using pointer = value_type*;
using const_pointer = const value_type*;
using iterator = pointer;
using const_iterator = const_pointer;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
constexpr explicit Span() = default;
constexpr Span(Span&&) noexcept = default;
constexpr Span& operator=(Span&&) noexcept = default;
constexpr Span(const Span&) noexcept = default;
constexpr Span& operator=(const Span&) noexcept = default;
template <typename It>
constexpr Span(It data, size_type size)
: m_data(data)
, m_size(size) {}
template <typename It>
constexpr Span(It start, It end)
: m_data(start)
, m_size(end - start) {}
template <typename Spannable>
constexpr Span(Spannable& s)
: m_data(s.data())
, m_size(s.size()) {}
template <typename Spannable>
constexpr Span(const Spannable& s)
: m_data(s.data())
, m_size(s.size()) {}
constexpr iterator begin() noexcept {
return m_data;
}
constexpr iterator end() noexcept {
return m_data + m_size;
}
constexpr const_iterator begin() const noexcept {
return m_data;
}
constexpr const_iterator end() const noexcept {
return m_data + m_size;
}
constexpr reference operator[](size_type index) {
return m_data[index];
}
constexpr const_reference operator[](size_type index) const {
return m_data[index];
}
constexpr reference front() {
return *m_data;
}
constexpr const_reference front() const {
return *m_data;
}
constexpr reference back() {
return m_data[m_size - 1];
}
constexpr const_reference back() const {
return m_data[m_size - 1];
}
constexpr pointer data() {
return m_data;
}
constexpr const_pointer data() const {
return m_data;
}
constexpr size_type size() const {
return m_size;
}
constexpr bool empty() const {
return m_size == 0;
}
private:
T* m_data = {};
size_type m_size = {};
};
}
|
whupdup/frame
|
src/core/span.hpp
|
C++
|
gpl-3.0
| 2,296
|
#pragma once
#include <core/algorithms.hpp>
#include <core/common.hpp>
#include <cassert>
#include <new>
#include <type_traits>
#include <utility>
namespace ZN {
template <typename... Types>
class Variant {
public:
static_assert(sizeof...(Types) < 255, "Cannot have more than 255 types in one variant");
using index_type = uint8_t;
static constexpr const index_type INVALID_INDEX = sizeof...(Types);
template <typename T>
static constexpr index_type index_of() {
return index_of_internal<T, 0, Types...>();
}
template <typename T>
static constexpr bool can_contain() {
return index_of<T>() != INVALID_INDEX;
}
constexpr Variant() noexcept = default;
template <typename T, typename StrippedT = std::remove_cv_t<T>>
ZN_FORCEINLINE Variant(T&& value) requires(can_contain<StrippedT>()) {
set(std::forward<StrippedT>(value));
}
template <typename T, typename StrippedT = std::remove_cv_t<T>>
ZN_FORCEINLINE Variant(const T& value) requires(can_contain<StrippedT>()) {
set(value);
}
~Variant() requires(!(std::is_destructible_v<Types> && ...)) = delete;
~Variant() requires(std::is_trivially_destructible_v<Types> && ...) = default;
ZN_FORCEINLINE ~Variant() requires(!(std::is_trivially_destructible_v<Types> && ...)) {
destroy_internal<0, Types...>();
}
Variant(Variant&&) requires(!(std::is_move_constructible_v<Types> && ...)) = delete;
Variant(Variant&&) noexcept = default;
ZN_FORCEINLINE Variant(Variant&& other) noexcept
requires(!(std::is_trivially_move_constructible_v<Types> && ...)) {
if (this != &other) {
move_internal<0, Types...>(other.m_index, other.m_data, m_data);
m_index = other.m_index;
other.m_index = INVALID_INDEX;
}
}
void operator=(Variant&&) requires(!(std::is_move_constructible_v<Types> && ...)
|| !(std::is_destructible_v<Types> && ...)) = delete;
Variant& operator=(Variant&&) noexcept = default;
ZN_FORCEINLINE Variant& operator=(Variant&& other) noexcept
requires(!(std::is_trivially_move_constructible_v<Types> && ...)
|| !(std::is_trivially_destructible_v<Types> && ...)) {
if (this != &other) {
if constexpr (!(std::is_trivially_destructible_v<Types> && ...)) {
destroy_internal<0, Types...>();
}
move_internal<0, Types...>(other.m_index, other.m_data, m_data);
m_index = other.m_index;
other.m_index = INVALID_INDEX;
}
return *this;
}
Variant(const Variant&) requires(!(std::is_copy_constructible_v<Types> && ...)) = delete;
Variant(const Variant&) = default;
ZN_FORCEINLINE Variant(const Variant& other)
requires(!(std::is_trivially_copy_constructible_v<Types> && ...)) {
copy_internal<0, Types...>(other.m_index, other.m_data, m_data);
m_index = other.m_index;
}
ZN_FORCEINLINE Variant& operator=(const Variant& other)
requires(!(std::is_trivially_copy_constructible_v<Types> && ...)
|| !(std::is_trivially_destructible_v<Types> && ...)) {
if (this != &other) {
if constexpr (!(std::is_trivially_destructible_v<Types> && ...)) {
destroy_internal<0, Types...>();
}
copy_internal<0, Types...>(other.m_index, other.m_data, m_data);
m_index = other.m_index;
}
return *this;
}
template <typename T, typename StrippedT = std::remove_cv_t<T>>
ZN_FORCEINLINE Variant& operator=(T&& value) noexcept requires(can_contain<StrippedT>()) {
set(std::forward<T>(value));
return *this;
}
template <typename T, typename StrippedT = std::remove_cv_t<T>>
ZN_FORCEINLINE Variant& operator=(const T& value) requires(can_contain<StrippedT>()) {
set(value);
return *this;
}
template <typename T, typename StrippedT = std::remove_cv_t<T>>
void set(T&& v) requires(can_contain<StrippedT>()
&& requires { StrippedT(std::forward<T>(v)); }) {
if (m_index != INVALID_INDEX) {
if constexpr (!(std::is_trivially_destructible_v<Types> && ...)) {
destroy_internal<0, Types...>();
}
}
m_index = index_of<StrippedT>();
new (m_data) StrippedT(std::forward<T>(v));
}
template <typename T, typename StrippedT = std::remove_cv_t<T>>
void set(const T& v) requires(can_contain<StrippedT>()
&& requires { StrippedT(v); }) {
if (m_index != INVALID_INDEX) {
if constexpr (!(std::is_trivially_destructible_v<Types> && ...)) {
destroy_internal<0, Types...>();
}
}
m_index = index_of<StrippedT>();
new (m_data) StrippedT(v);
}
template <typename T>
T& get() requires(can_contain<T>()) {
assert(has<T>() && "Invalid type attempted to be retrieved");
return *reinterpret_cast<T*>(m_data);
}
template <typename T>
const T& get() const requires(can_contain<T>()) {
return const_cast<Variant*>(this)->get<T>();
}
template <typename T>
operator T() const requires(can_contain<T>()) {
return get<T>();
}
template <typename T>
constexpr bool has() const {
return m_index == index_of<T>();
}
template <typename Visitor>
ZN_FORCEINLINE void visit(Visitor&& visitor) {
visit_internal<Visitor, 0, Types...>(std::forward<Visitor>(visitor));
}
private:
static constexpr const size_t DATA_SIZE = max<size_t>({sizeof(Types)...});
static constexpr const size_t DATA_ALIGN = max<size_t>({alignof(Types)...});
alignas(DATA_ALIGN) uint8_t m_data[DATA_SIZE] = {};
index_type m_index = INVALID_INDEX;
template <typename T, index_type InitialIndex, typename T0, typename... TOthers>
static consteval index_type index_of_internal() {
if constexpr (std::is_same_v<T, T0>) {
return InitialIndex;
}
else if constexpr (sizeof...(TOthers) > 0) {
return index_of_internal<T, InitialIndex + 1, TOthers...>();
}
else {
return InitialIndex + 1;
}
}
template <typename Visitor, index_type CheckIndex, typename T0, typename... TOthers>
ZN_FORCEINLINE constexpr void visit_internal(Visitor&& visitor) {
if (m_index == CheckIndex) {
visitor(*reinterpret_cast<T0*>(m_data));
}
else if constexpr (sizeof...(TOthers) > 0) {
visit_internal<Visitor, CheckIndex + 1, TOthers...>(
std::forward<Visitor>(visitor));
}
}
template <index_type CheckIndex, typename T0, typename... TOthers>
ZN_FORCEINLINE constexpr void destroy_internal() {
if (m_index == CheckIndex) {
reinterpret_cast<T0*>(m_data)->~T0();
m_index = INVALID_INDEX;
}
else if constexpr (sizeof...(TOthers) > 0) {
destroy_internal<CheckIndex + 1, TOthers...>();
}
}
template <index_type CheckIndex, typename T0, typename... TOthers>
ZN_FORCEINLINE static constexpr void move_internal(index_type oldIndex, void* oldData,
void* newData) {
if (oldIndex == CheckIndex) {
new (newData) T0(std::move(*reinterpret_cast<T0*>(oldData)));
}
else if constexpr (sizeof...(TOthers) > 0) {
move_internal<CheckIndex + 1, TOthers...>(oldIndex, oldData, newData);
}
}
template <index_type CheckIndex, typename T0, typename... TOthers>
ZN_FORCEINLINE static constexpr void copy_internal(index_type oldIndex,
const void* oldData, void* newData) {
if (oldIndex == CheckIndex) {
new (newData) T0(*reinterpret_cast<const T0*>(oldData));
}
else if constexpr (sizeof...(TOthers) > 0) {
copy_internal<CheckIndex + 1, TOthers...>(oldIndex, oldData, newData);
}
}
};
}
|
whupdup/frame
|
src/core/variant.hpp
|
C++
|
gpl-3.0
| 7,299
|
#include "barrier_info_collection.hpp"
#include <core/hash_builder.hpp>
#include <graphics/command_buffer.hpp>
#include <cstdio>
using namespace ZN;
using namespace ZN::GFX;
static bool image_barrier_equals(const VkImageMemoryBarrier& a, const VkImageMemoryBarrier& b);
static bool image_subresource_range_equals(const VkImageSubresourceRange& a,
const VkImageSubresourceRange& b);
void BarrierInfoCollection::add_pipeline_barrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask) {
m_info.try_emplace(StageInfo{srcStageMask, dstStageMask, 0});
}
void BarrierInfoCollection::add_image_memory_barrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
VkImageMemoryBarrier barrier) {
m_info[StageInfo{srcStageMask, dstStageMask, dependencyFlags}].imageBarriers
.emplace_back(std::move(barrier));
}
void BarrierInfoCollection::add_buffer_memory_barrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
VkBufferMemoryBarrier barrier) {
m_info[StageInfo{srcStageMask, dstStageMask, dependencyFlags}].bufferBarriers
.emplace_back(std::move(barrier));
}
void BarrierInfoCollection::emit_barriers(CommandBuffer& cmd) {
for (auto& [flags, barrierInfo] : m_info) {
cmd.pipeline_barrier(flags.srcStageMask, flags.dstStageMask, flags.dependencyFlags, 0,
nullptr, static_cast<uint32_t>(barrierInfo.bufferBarriers.size()),
barrierInfo.bufferBarriers.data(),
static_cast<uint32_t>(barrierInfo.imageBarriers.size()),
barrierInfo.imageBarriers.data());
}
//print_barriers();
m_info.clear();
}
bool BarrierInfoCollection::contains_barrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
VkDependencyFlags dependencyFlags, const VkImageMemoryBarrier& barrierIn) const {
if (auto it = m_info.find(StageInfo{srcStageMask, dstStageMask, dependencyFlags});
it != m_info.end()) {
for (auto& barrier : it->second.imageBarriers) {
if (image_barrier_equals(barrier, barrierIn)) {
return true;
}
}
}
return false;
}
size_t BarrierInfoCollection::get_pipeline_barrier_count() const {
return m_info.size();
}
size_t BarrierInfoCollection::get_image_memory_barrier_count(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags) const {
if (auto it = m_info.find(StageInfo{srcStageMask, dstStageMask, dependencyFlags});
it != m_info.end()) {
return it->second.imageBarriers.size();
}
return 0;
}
size_t BarrierInfoCollection::get_buffer_memory_barrier_count(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags) const {
if (auto it = m_info.find(StageInfo{srcStageMask, dstStageMask, dependencyFlags});
it != m_info.end()) {
return it->second.bufferBarriers.size();
}
return 0;
}
void BarrierInfoCollection::print_barriers() {
for (auto& [flags, barrierInfo] : m_info) {
puts("vkCmdPipelineBarrier(");
printf("\tsrcStageMask = 0x%X,\n", flags.srcStageMask);
printf("\tdstStageMask = 0x%X,\n", flags.dstStageMask);
printf("\tdependencyFlags = 0x%X,\n", flags.dependencyFlags);
puts("\tmemoryBarrierCount = 0,");
puts("\tpMemoryBarriers = nullptr,");
printf("\tbufferMemoryBarrierCount = %u\n", barrierInfo.bufferBarriers.size());
if (barrierInfo.bufferBarriers.empty()) {
puts("\tpBufferMemoryBarriers = nullptr,");
}
else {
puts("\tpBufferMemoryBarriers = {");
for (auto& barrier : barrierInfo.bufferBarriers) {
puts("\t\t{");
printf("\t\t\t.srcAccessMask = 0x%X\n", barrier.srcAccessMask);
printf("\t\t\t.dstAccessMask = 0x%X\n", barrier.dstAccessMask);
printf("\t\t\t.srcQueueFamilyIndex = %u\n", barrier.srcQueueFamilyIndex);
printf("\t\t\t.dstQueueFamilyIndex = %u\n", barrier.dstQueueFamilyIndex);
printf("\t\t\t.offset = %llu\n", barrier.offset);
printf("\t\t\t.size = %llu\n", barrier.size);
puts("\t\t},");
}
puts("\t}");
}
printf("\timageMemoryBarrierCount = %u\n", barrierInfo.imageBarriers.size());
if (barrierInfo.imageBarriers.empty()) {
puts("\tpImageMemoryBarriers = nullptr,");
}
else {
puts("\tpImageMemoryBarriers = {");
for (auto& barrier : barrierInfo.imageBarriers) {
puts("\t\t{");
printf("\t\t\t.srcAccessMask = 0x%X\n", barrier.srcAccessMask);
printf("\t\t\t.dstAccessMask = 0x%X\n", barrier.dstAccessMask);
printf("\t\t\t.oldLayout = %u\n", barrier.oldLayout);
printf("\t\t\t.newLayout = %u\n", barrier.newLayout);
printf("\t\t\t.srcQueueFamilyIndex = %u\n", barrier.srcQueueFamilyIndex);
printf("\t\t\t.dstQueueFamilyIndex = %u\n", barrier.dstQueueFamilyIndex);
puts("\t\t\t.subresourceRange = {");
printf("\t\t\t\t.aspectMask = 0x%X\n",
barrier.subresourceRange.aspectMask);
printf("\t\t\t\t.baseMipLevel = %u\n",
barrier.subresourceRange.baseMipLevel);
printf("\t\t\t\t.levelCount = %u\n", barrier.subresourceRange.levelCount);
printf("\t\t\t\t.baseArrayLayer = %u\n",
barrier.subresourceRange.baseArrayLayer);
printf("\t\t\t\t.layerCount = %u\n", barrier.subresourceRange.layerCount);
puts("\t\t\t}");
puts("\t\t},");
}
puts("\t}");
}
}
}
// StageInfo
bool BarrierInfoCollection::StageInfo::operator==(const StageInfo& other) const {
return srcStageMask == other.srcStageMask && dstStageMask == other.dstStageMask
&& dependencyFlags == other.dependencyFlags;
}
size_t BarrierInfoCollection::StageInfo::hash() const {
return HashBuilder{}
.add_uint32(srcStageMask)
.add_uint32(dstStageMask)
.add_uint32(dependencyFlags)
.get();
}
// StageInfoHash
size_t BarrierInfoCollection::StageInfoHash::operator()(const StageInfo& info) const {
return info.hash();
}
static bool image_barrier_equals(const VkImageMemoryBarrier& a, const VkImageMemoryBarrier& b) {
return a.srcAccessMask == b.srcAccessMask && a.dstAccessMask == b.dstAccessMask
&& a.oldLayout == b.oldLayout && a.newLayout == b.newLayout
&& a.srcQueueFamilyIndex == b.srcQueueFamilyIndex
&& a.dstQueueFamilyIndex == b.dstQueueFamilyIndex
&& a.image == b.image
&& image_subresource_range_equals(a.subresourceRange, b.subresourceRange);
}
static bool image_subresource_range_equals(const VkImageSubresourceRange& a,
const VkImageSubresourceRange& b) {
return a.aspectMask == b.aspectMask && a.baseMipLevel == b.baseMipLevel
&& a.levelCount == b.levelCount && a.baseArrayLayer == b.baseArrayLayer
&& a.layerCount == b.layerCount;
}
|
whupdup/frame
|
src/graphics/barrier_info_collection.cpp
|
C++
|
gpl-3.0
| 6,564
|
#pragma once
#include <vulkan.h>
#include <unordered_map>
#include <vector>
namespace ZN::GFX {
class CommandBuffer;
class BarrierInfoCollection final {
public:
void add_pipeline_barrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask);
void add_image_memory_barrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
VkImageMemoryBarrier barrier);
void add_buffer_memory_barrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
VkBufferMemoryBarrier barrier);
void emit_barriers(CommandBuffer&);
bool contains_barrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask,
VkDependencyFlags dependencyFlags, const VkImageMemoryBarrier& barrierIn) const;
size_t get_pipeline_barrier_count() const;
size_t get_image_memory_barrier_count(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags) const;
size_t get_buffer_memory_barrier_count(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags) const;
void print_barriers();
private:
struct BarrierInfo {
std::vector<VkImageMemoryBarrier> imageBarriers;
std::vector<VkBufferMemoryBarrier> bufferBarriers;
};
struct StageInfo {
VkPipelineStageFlags srcStageMask;
VkPipelineStageFlags dstStageMask;
VkDependencyFlags dependencyFlags;
bool operator==(const StageInfo& other) const;
size_t hash() const;
};
struct StageInfoHash {
size_t operator()(const StageInfo& info) const;
};
std::unordered_map<StageInfo, BarrierInfo, StageInfoHash> m_info;
};
}
|
whupdup/frame
|
src/graphics/barrier_info_collection.hpp
|
C++
|
gpl-3.0
| 1,746
|
#include "buffer.hpp"
#include <graphics/render_context.hpp>
using namespace ZN;
using namespace ZN::GFX;
Memory::IntrusivePtr<Buffer> Buffer::create(std::string name, VkDeviceSize size,
VkBufferUsageFlags usage) {
VkBuffer buffer{};
VkBufferCreateInfo createInfo{
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
.size = size,
.usage = usage
};
if (vkCreateBuffer(g_renderContext->get_device(), &createInfo, nullptr, &buffer)
== VK_SUCCESS) {
return Memory::make_intrusive<Buffer>(std::string(name), buffer, size, usage);
}
return nullptr;
}
Buffer::Buffer(std::string name, VkBuffer buffer, VkDeviceSize size, VkBufferUsageFlags usage)
: m_name(std::move(name))
, m_buffer(buffer)
, m_size(size)
, m_usageFlags(usage) {}
void Buffer::update_subresources(BarrierInfoCollection& barrierInfo,
const BufferResourceTracker::ResourceInfo& range,
BufferResourceTracker::BarrierMode barrierMode, bool ignorePreviousState) {
m_resourceTracker.update_range(m_buffer, barrierInfo, range, barrierMode, ignorePreviousState);
}
Buffer::operator VkBuffer() const {
return m_buffer;
}
const std::string& Buffer::get_name() const {
return m_name;
}
VkBuffer Buffer::get_buffer() const {
return m_buffer;
}
VkDeviceSize Buffer::get_size() const {
return m_size;
}
VkBufferUsageFlags Buffer::get_usage_flags() const {
return m_usageFlags;
}
|
whupdup/frame
|
src/graphics/buffer.cpp
|
C++
|
gpl-3.0
| 1,372
|
#pragma once
#include <core/intrusive_ptr.hpp>
#include <graphics/buffer_resource_tracker.hpp>
#include <string>
namespace ZN::GFX {
class Buffer final : public Memory::IntrusivePtrEnabled<Buffer> {
public:
static Memory::IntrusivePtr<Buffer> create(std::string name, VkDeviceSize size,
VkBufferUsageFlags usage);
explicit Buffer(std::string name, VkBuffer buffer, VkDeviceSize size,
VkBufferUsageFlags usage);
NULL_COPY_AND_ASSIGN(Buffer);
void update_subresources(BarrierInfoCollection& barrierInfo,
const BufferResourceTracker::ResourceInfo& range,
BufferResourceTracker::BarrierMode barrierMode, bool ignorePreviousState);
operator VkBuffer() const;
const std::string& get_name() const;
VkBuffer get_buffer() const;
VkDeviceSize get_size() const;
VkBufferUsageFlags get_usage_flags() const;
private:
std::string m_name;
VkBuffer m_buffer;
BufferResourceTracker m_resourceTracker;
VkDeviceSize m_size;
VkBufferUsageFlags m_usageFlags;
};
}
|
whupdup/frame
|
src/graphics/buffer.hpp
|
C++
|
gpl-3.0
| 1,002
|
#include "buffer_resource_tracker.hpp"
#include "graphics/buffer_resource_tracker.hpp"
#include <graphics/barrier_info_collection.hpp>
#include <algorithm>
#include <cstdio>
using namespace ZN;
using namespace ZN::GFX;
static bool test_range_start(const BufferResourceTracker::ResourceInfo& a,
const BufferResourceTracker::ResourceInfo& b);
static bool test_range_end(const BufferResourceTracker::ResourceInfo& a,
const BufferResourceTracker::ResourceInfo& b);
// ResourceInfo
bool BufferResourceTracker::ResourceInfo::states_equal(const ResourceInfo& other) const {
return stageFlags == other.stageFlags && accessMask == other.accessMask
&& queueFamilyIndex == other.queueFamilyIndex;
}
bool BufferResourceTracker::ResourceInfo::intersects(const ResourceInfo& other) const {
return offset < other.offset + other.size && offset + size > other.offset;
}
// this fully covers other
bool BufferResourceTracker::ResourceInfo::fully_covers(const ResourceInfo& other) const {
return other.offset >= offset && other.offset + other.size <= offset + size;
}
// BufferResourceTracker
void BufferResourceTracker::update_range(VkBuffer buffer, BarrierInfoCollection &barrierInfo,
const ResourceInfo &rangeIn, BarrierMode barrierMode, bool ignorePreviousState) {
insert_range_internal(buffer, rangeIn, barrierInfo, barrierMode, ignorePreviousState);
union_ranges();
print_ranges();
}
void BufferResourceTracker::print_ranges() {
puts("NEW STATES:");
for (auto& info : m_ranges) {
printf("\t{sf=0x%X, qf=%d, a=0x%X, {%u-%u}}\n", info.stageFlags, info.queueFamilyIndex,
info.accessMask, info.offset, info.offset + info.size);
}
}
size_t BufferResourceTracker::get_range_count() const {
return m_ranges.size();
}
void BufferResourceTracker::insert_range_internal(VkBuffer buffer, const ResourceInfo& rangeIn,
BarrierInfoCollection& barrierInfo, BarrierMode barrierMode, bool ignorePreviousState,
bool generateLastBarrier) {
/*auto checkEnd = std::upper_bound(m_ranges.begin(), m_ranges.end(), rangeIn, test_range_end);
auto checkStart = std::upper_bound(m_ranges.rbegin(), m_ranges.rend(), rangeIn,
test_range_start);
for (auto it = checkStart != m_ranges.rend() ? checkStart.base() : m_ranges.begin();
it != checkEnd; ++it) {*/
bool insertRangeIn = true;
if (!m_ranges.empty()) {
for (size_t i = m_ranges.size() - 1;; --i) {
auto& range = m_ranges[i];
auto statesEqual = range.states_equal(rangeIn);
bool needsQFOT = !ignorePreviousState
&& range.queueFamilyIndex != rangeIn.queueFamilyIndex;
if (range.fully_covers(rangeIn) && (statesEqual || needsQFOT)) {
// CASE 1: `rangeIn` is entirely covered by `range`, and states are equal, meaning
// no alternations need to be made to the range list
if (needsQFOT) {
add_barrier(buffer, barrierInfo, range, rangeIn, range.offset, range.size,
ignorePreviousState);
range.queueFamilyIndex = rangeIn.queueFamilyIndex;
}
else if (barrierMode == BarrierMode::ALWAYS) {
add_barrier(buffer, barrierInfo, range, rangeIn, rangeIn.offset,
rangeIn.size, ignorePreviousState);
}
return;
}
else if (rangeIn.fully_covers(range) && (ignorePreviousState || statesEqual)) {
// CASE 2: input range fully covers existing range, therefore remove it.
// This case is only valid if `rangeIn` can supersede the previous value
if (barrierMode == BarrierMode::ALWAYS) {
add_barrier(buffer, barrierInfo, range, rangeIn, range.offset, range.size,
ignorePreviousState);
generateLastBarrier = false;
}
m_ranges[i] = std::move(m_ranges.back());
m_ranges.pop_back();
}
else if (rangeIn.intersects(range)) {
// CASE 3: input range partially covers existing range, generate difference
// between the 2 ranges. If there is a barrier of interest, it will be on
// the intersection of both
//puts("CASE 3");
// CASE 3a: Needs QFOT, entire source range must be transitioned
if (needsQFOT && !rangeIn.fully_covers(range)) {
puts("CASE 3a");
add_barrier(buffer, barrierInfo, range, rangeIn, range.offset, range.size,
false);
generate_range_difference(rangeIn, range, buffer, barrierInfo, barrierMode,
ignorePreviousState, generateLastBarrier);
range.queueFamilyIndex = rangeIn.queueFamilyIndex;
generateLastBarrier = false;
insertRangeIn = false;
}
else {
auto rangeCopy = std::move(range);
m_ranges[i] = std::move(m_ranges.back());
m_ranges.pop_back();
bool needsUniqueBarriers = barrierMode == BarrierMode::ALWAYS || !statesEqual;
if (needsUniqueBarriers && barrierMode != BarrierMode::NEVER) {
auto oldState = make_range_intersection(rangeCopy, rangeIn);
add_barrier(buffer, barrierInfo, oldState, rangeIn, oldState.offset,
oldState.size, ignorePreviousState);
}
//puts("Emitting range difference of src range");
generate_range_difference(rangeCopy, rangeIn, buffer, barrierInfo, barrierMode,
ignorePreviousState, false);
if (!ignorePreviousState) {
if (needsUniqueBarriers) {
//puts("Emitting range difference of rangeIn");
generate_range_difference(rangeIn, rangeCopy, buffer, barrierInfo,
barrierMode, ignorePreviousState, generateLastBarrier);
m_ranges.emplace_back(make_range_intersection(rangeIn, rangeCopy));
return;
}
generateLastBarrier = false;
}
}
}
if (i == 0) {
break;
}
}
}
if (insertRangeIn) {
m_ranges.push_back(rangeIn);
}
if (generateLastBarrier && barrierMode != BarrierMode::NEVER) {
VkBufferMemoryBarrier barrier{
.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
.srcAccessMask = 0,
.dstAccessMask = rangeIn.accessMask,
.srcQueueFamilyIndex = rangeIn.queueFamilyIndex,
.dstQueueFamilyIndex = rangeIn.queueFamilyIndex,
.buffer = buffer,
.offset = rangeIn.offset,
.size = rangeIn.size
};
barrierInfo.add_buffer_memory_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
rangeIn.stageFlags, 0, std::move(barrier));
}
}
void BufferResourceTracker::generate_range_difference(const ResourceInfo& a, const ResourceInfo& b,
VkBuffer buffer, BarrierInfoCollection& barrierInfo, BarrierMode barrierMode,
bool ignorePreviousState, bool generateLastBarrier) {
auto aMinX = a.offset;
auto aMaxX = a.offset + a.size;
auto bMinX = b.offset;
auto bMaxX = b.offset + b.size;
if (aMinX < bMinX) {
//printf("Generate range difference: case 3 {%u, %u, %u, %u}\n", aMinX, sideMinY,
// bMinX, sideMaxY);
insert_range_like(a, buffer, barrierInfo, barrierMode, ignorePreviousState,
generateLastBarrier, aMinX, bMinX);
}
if (bMaxX < aMaxX) {
//printf("Generate range difference: case 4 {%u, %u, %u, %u}\n",
// bMaxX, sideMinY, aMaxX, sideMaxY);
insert_range_like(a, buffer, barrierInfo, barrierMode, ignorePreviousState,
generateLastBarrier, bMaxX, aMaxX);
}
}
void BufferResourceTracker::insert_range_like(const ResourceInfo& info, VkBuffer buffer,
BarrierInfoCollection& barrierInfo, BarrierMode barrierMode, bool ignorePreviousState,
bool generateLastBarrier, VkDeviceSize minX, VkDeviceSize maxX) {
insert_range_internal(buffer, create_range_like(info, minX, maxX), barrierInfo,
barrierMode, ignorePreviousState, generateLastBarrier);
}
void BufferResourceTracker::union_ranges() {
bool foundUnion = false;
do {
foundUnion = false;
for (size_t i = 0; i < m_ranges.size(); ++i) {
auto& a = m_ranges[i];
for (size_t j = i + 1; j < m_ranges.size(); ++j) {
auto& b = m_ranges[j];
if (!a.states_equal(b)) {
continue;
}
auto aMinX = a.offset;
auto aMaxX = a.offset + a.size;
auto bMinX = b.offset;
auto bMaxX = b.offset + b.size;
if (aMaxX == bMinX) {
foundUnion = true;
//printf("Union case 3 {%u, %u, %u, %u} U {%u, %u, %u, %u}\n",
// aMinX, aMinY, aMaxX, aMaxY, bMinX, bMinY, bMaxX, bMaxY);
a.size = bMaxX - aMinX;
}
else if (aMinX == bMaxX) {
foundUnion = true;
//puts("Union case 4");
a.offset = bMinX;
a.size = aMaxX - bMinX;
}
if (foundUnion) {
m_ranges[j] = std::move(m_ranges.back());
m_ranges.pop_back();
break;
}
}
if (foundUnion) {
break;
}
}
}
while (foundUnion);
}
BufferResourceTracker::ResourceInfo BufferResourceTracker::create_range_like(
const ResourceInfo& info, VkDeviceSize minX, VkDeviceSize maxX) {
return {
.stageFlags = info.stageFlags,
.accessMask = info.accessMask,
.offset = minX,
.size = maxX - minX,
.queueFamilyIndex = info.queueFamilyIndex
};
}
void BufferResourceTracker::add_barrier(VkBuffer buffer, BarrierInfoCollection& barrierInfo,
const ResourceInfo& from, const ResourceInfo& to, VkDeviceSize offset,
VkDeviceSize size, bool ignorePreviousState) {
VkBufferMemoryBarrier barrier{
.sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
.srcAccessMask = ignorePreviousState ? 0 : from.accessMask,
.dstAccessMask = to.accessMask,
.srcQueueFamilyIndex = from.queueFamilyIndex,
.dstQueueFamilyIndex = to.queueFamilyIndex,
.buffer = buffer,
.offset = offset,
.size = size
};
if (barrier.srcQueueFamilyIndex == barrier.dstQueueFamilyIndex) {
barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
}
barrierInfo.add_buffer_memory_barrier(from.stageFlags, to.stageFlags,
0 /* FIXME: figure out how to pass dependency flags */, std::move(barrier));
}
BufferResourceTracker::ResourceInfo BufferResourceTracker::make_range_intersection(
const ResourceInfo& a, const ResourceInfo& b) {
auto aMinX = a.offset;
auto aMaxX = a.offset + a.size;
auto bMinX = b.offset;
auto bMaxX = b.offset + b.size;
auto minX = aMinX > bMinX ? aMinX : bMinX;
auto maxX = aMaxX < bMaxX ? aMaxX : bMaxX;
return {
.stageFlags = a.stageFlags,
.accessMask = a.accessMask,
.offset = minX,
.size = maxX - minX,
.queueFamilyIndex = a.queueFamilyIndex
};
}
static bool test_range_start(const BufferResourceTracker::ResourceInfo& a,
const BufferResourceTracker::ResourceInfo& b) {
return a.offset + a.size < b.offset;
}
static bool test_range_end(const BufferResourceTracker::ResourceInfo& a,
const BufferResourceTracker::ResourceInfo& b) {
return a.offset > b.offset + b.size;
}
|
whupdup/frame
|
src/graphics/buffer_resource_tracker.cpp
|
C++
|
gpl-3.0
| 10,366
|
#pragma once
#include <vulkan.h>
#include <vector>
namespace ZN::GFX {
class BarrierInfoCollection;
class BufferResourceTracker final {
public:
struct ResourceInfo {
VkPipelineStageFlags stageFlags;
VkAccessFlags accessMask;
VkDeviceSize offset;
VkDeviceSize size;
uint32_t queueFamilyIndex;
bool states_equal(const ResourceInfo& other) const;
bool intersects(const ResourceInfo& other) const;
bool fully_covers(const ResourceInfo& other) const;
};
enum class BarrierMode {
ALWAYS,
NEVER
};
void update_range(VkBuffer buffer, BarrierInfoCollection& barrierInfo,
const ResourceInfo& rangeIn, BarrierMode barrierMode, bool ignorePreviousState);
void print_ranges();
size_t get_range_count() const;
private:
std::vector<ResourceInfo> m_ranges;
void insert_range_internal(VkBuffer buffer, const ResourceInfo& rangeIn,
BarrierInfoCollection& barrierInfo, BarrierMode barrierMode,
bool ignorePreviousState, bool generateLastBarrier = true);
// Emits ranges that are pieces of A if B was subtracted from it, meaning the resulting
// ranges include none of B's coverage
void generate_range_difference(const ResourceInfo& a, const ResourceInfo& b,
VkBuffer buffer, BarrierInfoCollection& barrierInfo, BarrierMode barrierMode,
bool ignorePreviousState, bool generateLastBarrier);
void insert_range_like(const ResourceInfo& info, VkBuffer buffer,
BarrierInfoCollection& barrierInfo, BarrierMode barrierMode,
bool ignorePreviousState, bool generateLastBarrier, VkDeviceSize minX,
VkDeviceSize maxX);
void union_ranges();
static ResourceInfo create_range_like(const ResourceInfo& info, VkDeviceSize minX,
VkDeviceSize maxX);
static void add_barrier(VkBuffer buffer, BarrierInfoCollection& barrierInfo,
const ResourceInfo& from, const ResourceInfo& to, VkDeviceSize offset,
VkDeviceSize size, bool ignorePreviousState);
static ResourceInfo make_range_intersection(const ResourceInfo& a, const ResourceInfo& b);
};
}
|
whupdup/frame
|
src/graphics/buffer_resource_tracker.hpp
|
C++
|
gpl-3.0
| 2,026
|
#include "command_buffer.hpp"
using namespace ZN;
using namespace ZN::GFX;
void CommandBuffer::begin_render_pass(const VkRenderPassBeginInfo* pRenderPassBegin,
VkSubpassContents) {
m_commands.emplace_back(new CmdBeginRenderPass{pRenderPassBegin->renderPass,
pRenderPassBegin->framebuffer, pRenderPassBegin->renderArea,
pRenderPassBegin->clearValueCount});
}
void CommandBuffer::next_subpass(VkSubpassContents) {
m_commands.emplace_back(new CmdNextSubpass);
}
void CommandBuffer::end_render_pass() {
m_commands.emplace_back(new CmdEndRenderPass);
}
void CommandBuffer::draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex,
uint32_t firstInstance) {
m_commands.emplace_back(new CmdDraw{vertexCount, instanceCount, firstVertex, firstInstance});
}
void CommandBuffer::dispatch(uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) {
m_commands.emplace_back(new CmdDispatch{groupCountX, groupCountY, groupCountZ});
}
void CommandBuffer::pipeline_barrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {
m_commands.emplace_back(new CmdPipelineBarrier{srcStageMask, dstStageMask, dependencyFlags,
memoryBarrierCount, pMemoryBarriers, bufferMemoryBarrierCount, pBufferMemoryBarriers,
imageMemoryBarrierCount, pImageMemoryBarriers});
}
bool CommandBuffer::operator==(const CommandBuffer& other) const {
if (m_commands.size() != other.m_commands.size()) {
return false;
}
for (size_t i = 0; i < m_commands.size(); ++i) {
if (*m_commands[i] != *other.m_commands[i]) {
return false;
}
}
return true;
}
void CommandBuffer::print() const {
for (auto& pCmd : m_commands) {
pCmd->print();
}
}
|
whupdup/frame
|
src/graphics/command_buffer.cpp
|
C++
|
gpl-3.0
| 1,964
|
#pragma once
#include <graphics/commands.hpp>
#include <memory>
namespace ZN::GFX {
class CommandBuffer final {
public:
explicit CommandBuffer() = default;
NULL_COPY_AND_ASSIGN(CommandBuffer);
void begin_render_pass(const VkRenderPassBeginInfo* pRenderPassBegin,
VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE);
void next_subpass(VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE);
void end_render_pass();
void draw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex,
uint32_t firstInstance);
void draw_indexed(uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex,
int32_t vertexOffset, uint32_t firstInstance);
void dispatch(uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ);
void pipeline_barrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask,
VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers);
bool operator==(const CommandBuffer&) const;
const std::vector<std::unique_ptr<Command>>& get_commands() const {
return m_commands;
}
void print() const;
private:
std::vector<std::unique_ptr<Command>> m_commands;
};
}
|
whupdup/frame
|
src/graphics/command_buffer.hpp
|
C++
|
gpl-3.0
| 1,400
|
#include "commands.hpp"
#include <type_traits>
#include <cstdio>
using namespace ZN;
using namespace ZN::GFX;
template <typename T, typename Functor>
static void for_each_bit(T value, Functor&& func) {
for (size_t i = 0; i < 8ull * sizeof(value); ++i) {
auto v = value & (static_cast<T>(1) << i);
if (!v) {
continue;
}
func(v);
}
}
static void print_image_layout(VkImageLayout layout) {
switch (layout) {
case VK_IMAGE_LAYOUT_UNDEFINED:
puts("VK_IMAGE_LAYOUT_UNDEFINED");
break;
case VK_IMAGE_LAYOUT_GENERAL:
puts("VK_IMAGE_LAYOUT_GENERAL");
break;
case VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL:
puts("VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL");
break;
default:
printf("%u\n", layout);
break;
}
}
template <typename Enum>
static void print_flag_bit(std::underlying_type_t<Enum> flagBit);
template<>
void print_flag_bit<VkPipelineStageFlagBits>(VkPipelineStageFlags stageFlag) {
switch (stageFlag) {
case VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT:
printf("VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT");
break;
case VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT:
printf("VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT");
break;
case VK_PIPELINE_STAGE_VERTEX_INPUT_BIT:
printf("VK_PIPELINE_STAGE_VERTEX_INPUT_BIT");
break;
case VK_PIPELINE_STAGE_VERTEX_SHADER_BIT:
printf("VK_PIPELINE_STAGE_VERTEX_SHADER_BIT");
break;
case VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT:
printf("VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT");
break;
case VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT:
printf("VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT");
break;
case VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT:
printf("VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT");
break;
case VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT:
printf("VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT");
break;
case VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT:
printf("VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT");
break;
case VK_PIPELINE_STAGE_TRANSFER_BIT:
printf("VK_PIPELINE_STAGE_TRANSFER_BIT");
break;
case VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT:
printf("VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT");
break;
default:
printf("0x%X");
break;
}
}
template<>
void print_flag_bit<VkAccessFlagBits>(VkAccessFlags accessFlag) {
switch (accessFlag) {
case VK_ACCESS_INDIRECT_COMMAND_READ_BIT:
printf("VK_ACCESS_INDIRECT_COMMAND_READ_BIT");
break;
case VK_ACCESS_INDEX_READ_BIT:
printf("VK_ACCESS_INDEX_READ_BIT");
break;
case VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT:
printf("VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT");
break;
case VK_ACCESS_UNIFORM_READ_BIT:
printf("VK_ACCESS_UNIFORM_READ_BIT");
break;
case VK_ACCESS_INPUT_ATTACHMENT_READ_BIT:
printf("VK_ACCESS_INPUT_ATTACHMENT_READ_BIT");
break;
case VK_ACCESS_SHADER_READ_BIT:
printf("VK_ACCESS_SHADER_READ_BIT");
break;
case VK_ACCESS_SHADER_WRITE_BIT:
printf("VK_ACCESS_SHADER_WRITE_BIT");
break;
case VK_ACCESS_COLOR_ATTACHMENT_READ_BIT:
printf("VK_ACCESS_COLOR_ATTACHMENT_READ_BIT");
break;
case VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT:
printf("VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT");
break;
case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT:
printf("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT");
break;
case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT:
printf("VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT");
break;
case VK_ACCESS_TRANSFER_READ_BIT:
printf("VK_ACCESS_TRANSFER_READ_BIT");
break;
case VK_ACCESS_TRANSFER_WRITE_BIT:
printf("VK_ACCESS_TRANSFER_WRITE_BIT");
break;
case VK_ACCESS_HOST_READ_BIT:
printf("VK_ACCESS_HOST_READ_BIT");
break;
case VK_ACCESS_HOST_WRITE_BIT:
printf("VK_ACCESS_HOST_WRITE_BIT");
break;
case VK_ACCESS_MEMORY_READ_BIT:
printf("VK_ACCESS_MEMORY_READ_BIT");
break;
case VK_ACCESS_MEMORY_WRITE_BIT:
printf("VK_ACCESS_MEMORY_WRITE_BIT");
break;
default:
printf("0x%X");
break;
}
}
template <typename Enum>
static void print_flags(std::underlying_type_t<Enum> flags) {
if (flags == 0) {
puts("0x0");
return;
}
bool first = true;
for_each_bit(flags, [&](auto v) {
if (!first) {
printf(" | ");
}
print_flag_bit<Enum>(v);
first = false;
});
putchar('\n');
}
void CmdDraw::print() const {
printf("vkCmdDraw(vertexCount = %u, instanceCount = %u, firstVertex = %u, firstInstance = %u)\n",
m_vertexCount, m_instanceCount, m_firstVertex, m_firstInstance);
}
CommandType CmdDraw::get_type() const {
return CommandType::DRAW;
}
bool CmdDraw::operator==(const Command& other) const {
if (get_type() != other.get_type()) {
return false;
}
auto& cmd = static_cast<const CmdDraw&>(other);
return m_vertexCount == cmd.m_vertexCount && m_instanceCount == cmd.m_instanceCount
&& m_firstVertex == cmd.m_firstVertex && m_firstInstance == cmd.m_firstInstance;
}
void CmdDispatch::print() const {
printf("vkCmdDispatch(groupCountX = %u, groupCountY = %u, groupCountZ = %u)\n",
m_groupCountX, m_groupCountY, m_groupCountZ);
}
CommandType CmdDispatch::get_type() const {
return CommandType::DISPATCH;
}
bool CmdDispatch::operator==(const Command& other) const {
if (get_type() != other.get_type()) {
return false;
}
auto& cmd = static_cast<const CmdDispatch&>(other);
return m_groupCountX == cmd.m_groupCountX && m_groupCountY == cmd.m_groupCountY
&& m_groupCountZ == cmd.m_groupCountZ;
}
CmdPipelineBarrier::CmdPipelineBarrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers)
: m_srcStageMask(srcStageMask)
, m_dstStageMask(dstStageMask)
, m_dependencyFlags(dependencyFlags)
, m_memoryBarriers(pMemoryBarriers, pMemoryBarriers + memoryBarrierCount)
, m_bufferMemoryBarriers(pBufferMemoryBarriers,
pBufferMemoryBarriers + bufferMemoryBarrierCount)
, m_imageMemoryBarriers(pImageMemoryBarriers,
pImageMemoryBarriers + imageMemoryBarrierCount) {}
void CmdPipelineBarrier::print() const {
puts("vkCmdPipelineBarrier(");
printf("\tsrcStageMask = ");
print_flags<VkPipelineStageFlagBits>(m_srcStageMask);
printf("\tdstStageMask = ");
print_flags<VkPipelineStageFlagBits>(m_dstStageMask);
printf("\tdependencyFlags = 0x%X,\n", m_dependencyFlags);
puts("\tmemoryBarrierCount = 0,");
puts("\tpMemoryBarriers = nullptr,");
printf("\tbufferMemoryBarrierCount = %u\n", m_bufferMemoryBarriers.size());
if (m_bufferMemoryBarriers.empty()) {
puts("\tpBufferMemoryBarriers = nullptr,");
}
else {
puts("\tpBufferMemoryBarriers = {");
for (auto& barrier : m_bufferMemoryBarriers) {
puts("\t\t{");
printf("\t\t\t.srcAccessMask = 0x%X\n", barrier.srcAccessMask);
printf("\t\t\t.dstAccessMask = 0x%X\n", barrier.dstAccessMask);
printf("\t\t\t.srcQueueFamilyIndex = %u\n", barrier.srcQueueFamilyIndex);
printf("\t\t\t.dstQueueFamilyIndex = %u\n", barrier.dstQueueFamilyIndex);
printf("\t\t\t.buffer = 0x%X\n", barrier.buffer);
printf("\t\t\t.offset = %llu\n", barrier.offset);
printf("\t\t\t.size = %llu\n", barrier.size);
puts("\t\t},");
}
puts("\t}");
}
printf("\timageMemoryBarrierCount = %u\n", m_imageMemoryBarriers.size());
if (m_imageMemoryBarriers.empty()) {
puts("\tpImageMemoryBarriers = nullptr,");
}
else {
puts("\tpImageMemoryBarriers = {");
for (auto& barrier : m_imageMemoryBarriers) {
puts("\t\t{");
printf("\t\t\t.srcAccessMask = ");
print_flags<VkAccessFlagBits>(barrier.srcAccessMask);
printf("\t\t\t.dstAccessMask = ");
print_flags<VkAccessFlagBits>(barrier.dstAccessMask);
printf("\t\t\t.oldLayout = ");
print_image_layout(barrier.oldLayout);
printf("\t\t\t.newLayout = ");
print_image_layout(barrier.newLayout);
if (barrier.srcQueueFamilyIndex == VK_QUEUE_FAMILY_IGNORED) {
puts("\t\t\t.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED");
}
else {
printf("\t\t\t.srcQueueFamilyIndex = %u\n", barrier.srcQueueFamilyIndex);
}
if (barrier.dstQueueFamilyIndex == VK_QUEUE_FAMILY_IGNORED) {
puts("\t\t\t.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED");
}
else {
printf("\t\t\t.dstQueueFamilyIndex = %u\n", barrier.dstQueueFamilyIndex);
}
printf("\t\t\t.image = 0x%X\n", barrier.image);
puts("\t\t\t.subresourceRange = {");
printf("\t\t\t\t.aspectMask = 0x%X\n",
barrier.subresourceRange.aspectMask);
printf("\t\t\t\t.baseMipLevel = %u\n",
barrier.subresourceRange.baseMipLevel);
printf("\t\t\t\t.levelCount = %u\n", barrier.subresourceRange.levelCount);
printf("\t\t\t\t.baseArrayLayer = %u\n",
barrier.subresourceRange.baseArrayLayer);
printf("\t\t\t\t.layerCount = %u\n", barrier.subresourceRange.layerCount);
puts("\t\t\t}");
puts("\t\t},");
}
puts("\t}");
}
}
CommandType CmdPipelineBarrier::get_type() const {
return CommandType::PIPELINE_BARRIER;
}
template <typename T>
static bool barrier_equals(const T& a, const T& b);
template <>
bool barrier_equals<VkMemoryBarrier>(const VkMemoryBarrier& a, const VkMemoryBarrier& b) {
return a.srcAccessMask == b.srcAccessMask && a.dstAccessMask == b.dstAccessMask;
}
template <>
bool barrier_equals<VkBufferMemoryBarrier>(const VkBufferMemoryBarrier& a,
const VkBufferMemoryBarrier& b) {
return a.srcAccessMask == b.srcAccessMask && a.dstAccessMask == b.dstAccessMask
&& a.srcQueueFamilyIndex == b.srcQueueFamilyIndex
&& a.dstQueueFamilyIndex == b.dstQueueFamilyIndex
&& a.buffer == b.buffer && a.offset == b.offset && a.size == b.size;
}
template <>
bool barrier_equals<VkImageMemoryBarrier>(const VkImageMemoryBarrier& a,
const VkImageMemoryBarrier& b) {
return a.srcAccessMask == b.srcAccessMask && a.dstAccessMask == b.dstAccessMask
&& a.oldLayout == b.oldLayout && a.newLayout == b.newLayout
&& a.srcQueueFamilyIndex == b.srcQueueFamilyIndex
&& a.dstQueueFamilyIndex == b.dstQueueFamilyIndex
&& a.image == b.image
&& a.subresourceRange.aspectMask == b.subresourceRange.aspectMask
&& a.subresourceRange.baseMipLevel == b.subresourceRange.baseMipLevel
&& a.subresourceRange.levelCount == b.subresourceRange.levelCount
&& a.subresourceRange.baseArrayLayer == b.subresourceRange.baseArrayLayer
&& a.subresourceRange.layerCount == b.subresourceRange.layerCount;
}
template <typename T>
static bool contains_barrier(const std::vector<T>& v, const T& barrier) {
for (auto& b : v) {
if (barrier_equals(b, barrier)) {
return true;
}
}
return false;
}
template <typename T>
static bool barriers_equal(const std::vector<T>& vA, const std::vector<T>& vB) {
for (auto& barrier : vA) {
if (!contains_barrier(vB, barrier)) {
return false;
}
}
for (auto& barrier : vB) {
if (!contains_barrier(vA, barrier)) {
return false;
}
}
return true;
}
bool CmdPipelineBarrier::operator==(const Command& other) const {
if (get_type() != other.get_type()) {
return false;
}
auto& cmd = static_cast<const CmdPipelineBarrier&>(other);
if (m_srcStageMask != cmd.m_srcStageMask || m_dstStageMask != cmd.m_dstStageMask
|| m_dependencyFlags != cmd.m_dependencyFlags
|| m_memoryBarriers.size() != cmd.m_memoryBarriers.size()
|| m_bufferMemoryBarriers.size() != cmd.m_bufferMemoryBarriers.size()
|| m_imageMemoryBarriers.size() != cmd.m_imageMemoryBarriers.size()) {
return false;
}
if (!barriers_equal(m_memoryBarriers, cmd.m_memoryBarriers)) {
return false;
}
if (!barriers_equal(m_bufferMemoryBarriers, cmd.m_bufferMemoryBarriers)) {
return false;
}
if (!barriers_equal(m_imageMemoryBarriers, cmd.m_imageMemoryBarriers)) {
return false;
}
return true;
}
void CmdBeginRenderPass::print() const {
puts("vkCmdBeginRenderPass(");
puts("\t.pRenderPassBegin = {");
printf("\t\t.renderPass = 0x%X\n", m_renderPass);
printf("\t\t.framebuffer = 0x%X\n", m_framebuffer);
puts("\t\t.renderArea = {");
printf("\t\t\t.offset = {%d, %d}\n", m_renderArea.offset.x, m_renderArea.offset.y);
printf("\t\t\t.extent = {%u, %u}\n", m_renderArea.extent.width, m_renderArea.extent.height);
puts("\t\t}");
printf("\t\t.clearValueCount = %u\n", m_clearValueCount);
puts("\t\t.pClearValues = ...");
puts("\t}");
puts(")");
}
CommandType CmdBeginRenderPass::get_type() const {
return CommandType::BEGIN_RENDER_PASS;
}
bool CmdBeginRenderPass::operator==(const Command& other) const {
if (get_type() != other.get_type()) {
return false;
}
auto& cmd = static_cast<const CmdBeginRenderPass&>(other);
return m_renderPass == cmd.m_renderPass && m_framebuffer == cmd.m_framebuffer
&& m_renderArea.offset.x == cmd.m_renderArea.offset.x
&& m_renderArea.offset.y == cmd.m_renderArea.offset.y
&& m_renderArea.extent.width == cmd.m_renderArea.extent.width
&& m_renderArea.extent.height == cmd.m_renderArea.extent.height
&& m_clearValueCount == cmd.m_clearValueCount;
}
void CmdEndRenderPass::print() const {
printf("vkCmdEndRenderPass()\n");
}
CommandType CmdEndRenderPass::get_type() const {
return CommandType::END_RENDER_PASS;
}
bool CmdEndRenderPass::operator==(const Command& other) const {
return get_type() == other.get_type();
}
void CmdNextSubpass::print() const {
printf("vkCmdNextSubpass()\n");
}
CommandType CmdNextSubpass::get_type() const {
return CommandType::NEXT_SUBPASS;
}
bool CmdNextSubpass::operator==(const Command& other) const {
return get_type() == other.get_type();
}
|
whupdup/frame
|
src/graphics/commands.cpp
|
C++
|
gpl-3.0
| 13,565
|
#pragma once
#include <core/common.hpp>
#include <vulkan.h>
#include <vector>
namespace ZN::GFX {
enum class CommandType : uint8_t {
DRAW,
DISPATCH,
PIPELINE_BARRIER,
BEGIN_RENDER_PASS,
END_RENDER_PASS,
NEXT_SUBPASS,
};
class Command {
public:
explicit Command() = default;
NULL_COPY_AND_ASSIGN(Command);
virtual void print() const = 0;
virtual CommandType get_type() const = 0;
virtual bool operator==(const Command&) const = 0;
bool operator!=(const Command& other) const {
return !(*this == other);
}
private:
};
class CmdDraw final : public Command {
public:
explicit CmdDraw(uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex,
uint32_t firstInstance)
: m_vertexCount(vertexCount)
, m_instanceCount(instanceCount)
, m_firstVertex(firstVertex)
, m_firstInstance(firstInstance) {}
void print() const override;
CommandType get_type() const override;
bool operator==(const Command&) const override;
private:
uint32_t m_vertexCount;
uint32_t m_instanceCount;
uint32_t m_firstVertex;
uint32_t m_firstInstance;
};
class CmdDispatch final : public Command {
public:
explicit CmdDispatch(uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ)
: m_groupCountX(groupCountX)
, m_groupCountY(groupCountY)
, m_groupCountZ(groupCountZ) {}
void print() const override;
CommandType get_type() const override;
bool operator==(const Command&) const override;
private:
uint32_t m_groupCountX;
uint32_t m_groupCountY;
uint32_t m_groupCountZ;
};
class CmdPipelineBarrier final : public Command {
public:
explicit CmdPipelineBarrier(VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags,
uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers);
void print() const override;
CommandType get_type() const override;
bool operator==(const Command&) const override;
private:
VkPipelineStageFlags m_srcStageMask;
VkPipelineStageFlags m_dstStageMask;
VkDependencyFlags m_dependencyFlags;
std::vector<VkMemoryBarrier> m_memoryBarriers;
std::vector<VkBufferMemoryBarrier> m_bufferMemoryBarriers;
std::vector<VkImageMemoryBarrier> m_imageMemoryBarriers;
};
class CmdBeginRenderPass final : public Command {
public:
explicit CmdBeginRenderPass(VkRenderPass renderPass, VkFramebuffer framebuffer,
VkRect2D renderArea, uint32_t clearValueCount)
: m_renderPass(renderPass)
, m_framebuffer(framebuffer)
, m_renderArea(renderArea)
, m_clearValueCount(clearValueCount) {}
void print() const override;
CommandType get_type() const override;
bool operator==(const Command&) const override;
private:
VkRenderPass m_renderPass;
VkFramebuffer m_framebuffer;
VkRect2D m_renderArea;
uint32_t m_clearValueCount;
};
class CmdEndRenderPass final : public Command {
public:
void print() const override;
CommandType get_type() const override;
bool operator==(const Command&) const override;
};
class CmdNextSubpass final : public Command {
public:
void print() const override;
CommandType get_type() const override;
bool operator==(const Command&) const override;
};
}
|
whupdup/frame
|
src/graphics/commands.hpp
|
C++
|
gpl-3.0
| 3,394
|
#include "frame_graph.hpp"
#include <graphics/barrier_info_collection.hpp>
#include <graphics/command_buffer.hpp>
#include <graphics/render_context.hpp>
#include <algorithm>
using namespace ZN;
using namespace ZN::GFX;
static bool has_incompatible_depth_attachments(const FrameGraphPass& pA, const FrameGraphPass& pB);
static void emit_pass_barriers(const FrameGraphPass& pass, BarrierInfoCollection& barrierInfo,
FrameGraph::AccessTracker& lastAccesses);
static VkAccessFlags image_access_to_access_flags(VkPipelineStageFlags stageFlags,
ResourceAccess::Enum access);
static VkAccessFlags buffer_access_to_access_flags(VkPipelineStageFlags stageFlags,
ResourceAccess::Enum access, VkBufferUsageFlags usage);
// AccessTracker
class FrameGraph::AccessTracker {
public:
ImageResourceTracker::BarrierMode get_barrier_mode(const Memory::IntrusivePtr<ImageView>&
pImageView) const {
if (auto it = m_imageAccesses.find(pImageView); it != m_imageAccesses.end()
&& (it->second & ResourceAccess::WRITE)) {
return ImageResourceTracker::BarrierMode::ALWAYS;
}
return ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY;
}
BufferResourceTracker::BarrierMode get_barrier_mode(const Memory::IntrusivePtr<Buffer>&
pBuffer) const {
if (auto it = m_bufferAccesses.find(pBuffer); it != m_bufferAccesses.end()
&& (it->second & ResourceAccess::WRITE)) {
return BufferResourceTracker::BarrierMode::ALWAYS;
}
return BufferResourceTracker::BarrierMode::NEVER;
}
void update_access(const Memory::IntrusivePtr<ImageView>& pImageView,
ResourceAccess::Enum access) {
m_imageAccesses.insert_or_assign(pImageView, access);
}
void update_access(const Memory::IntrusivePtr<Buffer>& pBuffer,
ResourceAccess::Enum access) {
m_bufferAccesses.insert_or_assign(pBuffer, access);
}
private:
std::unordered_map<Memory::IntrusivePtr<ImageView>, ResourceAccess::Enum> m_imageAccesses;
std::unordered_map<Memory::IntrusivePtr<Buffer>, ResourceAccess::Enum> m_bufferAccesses;
};
// RenderPassInterval
FrameGraph::RenderPassInterval::RenderPassInterval(uint32_t startIndex, uint32_t endIndex)
: m_startIndex(startIndex)
, m_endIndex(endIndex)
, m_depthAttachment{}
, m_createInfo{} {}
void FrameGraph::RenderPassInterval::register_pass(const FrameGraphPass& pass) {
m_subpasses.emplace_back();
auto& subpass = m_subpasses.back();
if (pass.has_depth_attachment()) {
auto access = pass.get_depth_stencil_info().access;
if (!m_depthAttachment) {
m_depthAttachment = pass.get_depth_stencil_resource();
m_createInfo.depthAttachment = {
.format = m_depthAttachment->get_image().get_format(),
.samples = m_depthAttachment->get_image().get_sample_count()
};
if (pass.get_depth_stencil_info().clear) {
m_createInfo.createFlags |= RenderPass::CREATE_FLAG_CLEAR_DEPTH_STENCIL;
}
else if (access & ResourceAccess::READ) {
m_createInfo.createFlags |= RenderPass::CREATE_FLAG_LOAD_DEPTH_STENCIL;
}
}
if (access & ResourceAccess::WRITE) {
m_createInfo.createFlags |= RenderPass::CREATE_FLAG_STORE_DEPTH_STENCIL;
}
else {
m_createInfo.createFlags &= ~RenderPass::CREATE_FLAG_STORE_DEPTH_STENCIL;
}
switch (access) {
case ResourceAccess::READ:
subpass.depthStencilUsage = RenderPass::DepthStencilUsage::READ;
break;
case ResourceAccess::WRITE:
subpass.depthStencilUsage = RenderPass::DepthStencilUsage::WRITE;
break;
case ResourceAccess::READ_WRITE:
subpass.depthStencilUsage = RenderPass::DepthStencilUsage::READ_WRITE;
break;
default:
subpass.depthStencilUsage = RenderPass::DepthStencilUsage::NONE;
}
}
pass.for_each_color_attachment([&](const auto& pImageView, const auto& res) {
register_color_attachment(pImageView, res.clear, res.access, subpass.colorAttachments,
subpass.colorAttachmentCount);
});
pass.for_each_input_attachment([&](const auto& pImageView) {
register_color_attachment(pImageView, false, ResourceAccess::READ,
subpass.inputAttachments, subpass.inputAttachmentCount);
});
}
void FrameGraph::RenderPassInterval::increment_end_index() {
++m_endIndex;
}
void FrameGraph::RenderPassInterval::emit_barriers(AccessTracker& lastAccesses,
BarrierInfoCollection& barrierInfo) const {
for (size_t i = 0; i < m_colorAttachments.size(); ++i) {
auto& pImageView = m_colorAttachments[i];
bool loadAttachment = (m_createInfo.loadAttachmentMask >> i) & 1;
auto layout = pImageView->is_swapchain_image() ? VK_IMAGE_LAYOUT_PRESENT_SRC_KHR
: VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
emit_barriers_for_image(lastAccesses, barrierInfo, pImageView, loadAttachment,
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, layout,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT);
}
if (m_depthAttachment) {
bool loadAttachment = m_createInfo.createFlags
& RenderPass::CREATE_FLAG_LOAD_DEPTH_STENCIL;
emit_barriers_for_image(lastAccesses, barrierInfo, m_depthAttachment, loadAttachment,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
| VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT
| VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT);
}
}
FrameGraph::RenderPassData FrameGraph::RenderPassInterval::build() {
m_createInfo.pSubpasses = m_subpasses.data();
m_createInfo.subpassCount = static_cast<uint8_t>(m_subpasses.size());
auto renderPass = RenderPass::create(m_createInfo);
if (m_depthAttachment) {
m_colorAttachments.emplace_back(std::move(m_depthAttachment));
m_depthAttachment = {};
}
auto attachCount = m_colorAttachments.size();
auto& extent = m_colorAttachments.back()->get_image().get_extent();
auto framebuffer = Framebuffer::create(*renderPass, std::move(m_colorAttachments),
extent.width, extent.height);
return {
.renderPass = std::move(renderPass),
.framebuffer = std::move(framebuffer),
.clearValues = std::move(m_clearValues),
.startIndex = m_startIndex,
.endIndex = m_endIndex
};
}
void FrameGraph::RenderPassInterval::register_color_attachment(
const Memory::IntrusivePtr<ImageView>& pImageView, bool clear, ResourceAccess::Enum access,
RenderPass::AttachmentIndex_T* attachIndices,
RenderPass::AttachmentCount_T& attachCountInOut) {
auto mask = static_cast<RenderPass::AttachmentBitMask_T>(1u << m_colorAttachments.size());
auto idx = get_color_attachment_index(pImageView);
if (idx == RenderPass::INVALID_ATTACHMENT_INDEX) {
if (clear) {
m_createInfo.clearAttachmentMask |= mask;
}
else if (access & ResourceAccess::READ) {
m_createInfo.loadAttachmentMask |= mask;
}
m_createInfo.colorAttachments[m_createInfo.colorAttachmentCount] = {
.format = pImageView->get_image().get_format(),
.samples = pImageView->get_image().get_sample_count()
};
idx = static_cast<RenderPass::AttachmentIndex_T>(m_createInfo.colorAttachmentCount);
m_colorAttachments.push_back(pImageView);
++m_createInfo.colorAttachmentCount;
if (pImageView->is_swapchain_image()) {
m_createInfo.swapchainAttachmentMask |= mask;
}
}
attachIndices[attachCountInOut++] = idx;
if (access & ResourceAccess::WRITE) {
m_createInfo.storeAttachmentMask |= mask;
}
else {
m_createInfo.storeAttachmentMask &= ~mask;
}
}
void FrameGraph::RenderPassInterval::emit_barriers_for_image(AccessTracker& lastAccesses,
BarrierInfoCollection& barrierInfo, const Memory::IntrusivePtr<ImageView>& pImageView,
bool loadImage, VkPipelineStageFlags stageFlags, VkImageLayout layout,
VkAccessFlags accessMask) const {
auto barrierMode = lastAccesses.get_barrier_mode(pImageView);
if (barrierMode == ImageResourceTracker::BarrierMode::ALWAYS || loadImage) {
pImageView->get_image().update_subresources(barrierInfo, {
.stageFlags = stageFlags,
.layout = layout,
.accessMask = accessMask,
.queueFamilyIndex = g_renderContext->get_graphics_queue_family(),
.range = pImageView->get_subresource_range()
}, barrierMode, !loadImage);
}
pImageView->get_image().update_subresources(barrierInfo, {
.stageFlags = stageFlags,
.layout = layout,
.accessMask = accessMask,
.queueFamilyIndex = g_renderContext->get_graphics_queue_family(),
.range = pImageView->get_subresource_range()
}, ImageResourceTracker::BarrierMode::NEVER, false);
lastAccesses.update_access(pImageView, ResourceAccess::READ_WRITE);
}
uint32_t FrameGraph::RenderPassInterval::get_start_index() const {
return m_startIndex;
}
uint32_t FrameGraph::RenderPassInterval::get_end_index() const {
return m_endIndex;
}
RenderPass::AttachmentIndex_T FrameGraph::RenderPassInterval::get_color_attachment_index(
const Memory::IntrusivePtr<ImageView>& pImageView) const {
for (RenderPass::AttachmentIndex_T i = 0; i < m_createInfo.colorAttachmentCount; ++i) {
if (pImageView == m_colorAttachments[i]) {
return i;
}
}
return RenderPass::INVALID_ATTACHMENT_INDEX;
}
// FrameGraph
FrameGraphPass& FrameGraph::add_pass(std::string name) {
m_passes.emplace_back(std::make_unique<FrameGraphPass>(*this, std::move(name)));
return *m_passes.back();
}
void FrameGraph::build(CommandBuffer& cmd) {
std::vector<BarrierInfoCollection> barrierInfos(m_passes.size());
merge_render_passes();
build_barriers(barrierInfos);
build_physical_render_passes();
emit_commands(cmd, barrierInfos);
//print_raw_subpasses();
}
void FrameGraph::print_raw_subpasses() {
puts("SUBPASSES");
for (auto& pass : m_passes) {
pass->print();
}
}
void FrameGraph::merge_render_passes() {
for (uint32_t i = 0, l = static_cast<uint32_t>(m_passes.size()); i < l - 1; ++i) {
auto& pA = *m_passes[i];
if (!pA.is_render_pass()) {
continue;
}
if (m_passes[i + 1]->is_render_pass() && can_merge_render_passes(pA, *m_passes[i + 1])) {
auto renderPassIndex = pA.get_render_pass_index();
if (renderPassIndex == FrameGraphPass::INVALID_RENDER_PASS_INDEX) {
renderPassIndex = static_cast<uint32_t>(m_renderPassIntervals.size());
pA.set_render_pass_index(renderPassIndex);
m_renderPassIntervals.emplace_back(i, i + 2);
m_renderPassIntervals.back().register_pass(pA);
}
else {
m_renderPassIntervals[renderPassIndex].increment_end_index();
}
m_passes[i + 1]->set_render_pass_index(renderPassIndex);
m_renderPassIntervals[renderPassIndex].register_pass(*m_passes[i + 1]);
continue;
}
bool mergedPass = false;
for (uint32_t j = i + 2; j < l; ++j) {
auto& pB = *m_passes[j];
if (!pB.is_render_pass()) {
continue;
}
if (can_merge_render_passes(pA, pB) && can_swap_passes(i + 1, j)) {
mergedPass = true;
auto renderPassIndex = pA.get_render_pass_index();
if (pA.get_render_pass_index() == FrameGraphPass::INVALID_RENDER_PASS_INDEX) {
renderPassIndex = static_cast<uint32_t>(m_renderPassIntervals.size());
pA.set_render_pass_index(renderPassIndex);
m_renderPassIntervals.emplace_back(i, i + 2);
m_renderPassIntervals.back().register_pass(pA);
}
else {
m_renderPassIntervals[renderPassIndex].increment_end_index();
}
pB.set_render_pass_index(renderPassIndex);
m_renderPassIntervals[renderPassIndex].register_pass(pB);
std::swap(m_passes[i + 1], m_passes[j]);
break;
}
}
if (!mergedPass
&& pA.get_render_pass_index() == FrameGraphPass::INVALID_RENDER_PASS_INDEX) {
pA.set_render_pass_index(static_cast<uint32_t>(m_renderPassIntervals.size()));
m_renderPassIntervals.emplace_back(i, i + 1);
m_renderPassIntervals.back().register_pass(pA);
}
}
if (!m_passes.empty() && m_passes.back()->is_render_pass()
&& m_passes.back()->get_render_pass_index()
== FrameGraphPass::INVALID_RENDER_PASS_INDEX) {
m_passes.back()->set_render_pass_index(static_cast<uint32_t>(
m_renderPassIntervals.size()));
auto idx = static_cast<uint32_t>(m_passes.size() - 1);
m_renderPassIntervals.emplace_back(idx, idx + 1);
m_renderPassIntervals.back().register_pass(*m_passes.back());
}
}
void FrameGraph::build_barriers(std::vector<BarrierInfoCollection>& barrierInfos) {
AccessTracker lastAccesses{};
for (uint32_t i = 0, l = static_cast<uint32_t>(m_passes.size()); i < l;) {
auto& barrierInfo = barrierInfos[i];
auto rpIdx = m_passes[i]->get_render_pass_index();
if (rpIdx != FrameGraphPass::INVALID_RENDER_PASS_INDEX) {
auto& interval = m_renderPassIntervals[rpIdx];
interval.emit_barriers(lastAccesses, barrierInfo);
for (; i < interval.get_end_index(); ++i) {
emit_pass_barriers(*m_passes[i], barrierInfo, lastAccesses);
}
}
else {
emit_pass_barriers(*m_passes[i], barrierInfo, lastAccesses);
++i;
}
}
}
void FrameGraph::build_physical_render_passes() {
m_renderPasses.reserve(m_renderPassIntervals.size());
for (auto& interval : m_renderPassIntervals) {
m_renderPasses.emplace_back(interval.build());
}
}
void FrameGraph::emit_commands(CommandBuffer& cmd,
std::vector<BarrierInfoCollection>& barrierInfos) {
for (uint32_t i = 0, l = static_cast<uint32_t>(m_passes.size()); i < l;) {
auto& barrierInfo = barrierInfos[i];
auto rpIdx = m_passes[i]->get_render_pass_index();
barrierInfo.emit_barriers(cmd);
if (rpIdx != FrameGraphPass::INVALID_RENDER_PASS_INDEX) {
auto& rpData = m_renderPasses[rpIdx];
VkRenderPassBeginInfo beginInfo{
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
.renderPass = *rpData.renderPass,
.framebuffer = *rpData.framebuffer,
.renderArea = {
.offset = {},
.extent = {
rpData.framebuffer->get_width(),
rpData.framebuffer->get_height()
}
},
.clearValueCount = static_cast<uint32_t>(rpData.clearValues.size()),
.pClearValues = rpData.clearValues.data()
};
cmd.begin_render_pass(&beginInfo);
for (; i < rpData.endIndex; ++i) {
m_passes[i]->write_commands(cmd);
if (i != rpData.endIndex - 1) {
cmd.next_subpass();
}
}
cmd.end_render_pass();
}
else {
m_passes[i]->write_commands(cmd);
++i;
}
}
}
bool FrameGraph::can_swap_passes(uint32_t pI, uint32_t pJ) const {
if (pI > pJ) {
return can_swap_passes(pJ, pI);
}
auto& first = *m_passes[pI];
auto& last = *m_passes[pJ];
if (first.writes_resources_of_pass(last) || last.writes_resources_of_pass(first)) {
return false;
}
for (uint32_t i = pI + 1; i < pJ; ++i) {
auto& pass = *m_passes[i];
if (first.writes_resources_of_pass(pass) || last.writes_resources_of_pass(pass)
|| pass.writes_resources_of_pass(first)
|| pass.writes_resources_of_pass(last)) {
return false;
}
}
return true;
}
bool FrameGraph::can_merge_render_passes(const FrameGraphPass& pA,
const FrameGraphPass& pB) const {
if (pA.writes_non_attachments_of_pass(pB)) {
return false;
}
if (pB.clears_attachments_of_pass(pA)) {
return false;
}
if (pA.get_render_pass_index() == FrameGraphPass::INVALID_RENDER_PASS_INDEX) {
if (has_incompatible_depth_attachments(pA, pB)) {
return false;
}
}
else {
auto& interval = m_renderPassIntervals[pA.get_render_pass_index()];
for (auto i = interval.get_start_index(); i < interval.get_end_index(); ++i) {
if (has_incompatible_depth_attachments(*m_passes[i], pB)) {
return false;
}
}
}
return true;
}
bool FrameGraph::is_first_render_pass(uint32_t index) const {
auto& pass = *m_passes[index];
return pass.get_render_pass_index() != FrameGraphPass::INVALID_RENDER_PASS_INDEX
&& index == m_renderPassIntervals[pass.get_render_pass_index()].get_start_index();
}
static bool has_incompatible_depth_attachments(const FrameGraphPass& pA,
const FrameGraphPass& pB) {
return pA.has_depth_attachment() && pB.has_depth_attachment()
&& !pA.has_depth_attachment(pB.get_depth_stencil_resource());
}
static void emit_pass_barriers(const FrameGraphPass& pass, BarrierInfoCollection& barrierInfo,
FrameGraph::AccessTracker& lastAccesses) {
pass.for_each_texture([&](const auto& pImageView, const auto& dep) {
pImageView->get_image().update_subresources(barrierInfo, {
.stageFlags = dep.stageFlags,
.layout = dep.layout,
.accessMask = image_access_to_access_flags(dep.stageFlags, dep.access),
.queueFamilyIndex = g_renderContext->get_graphics_queue_family(),
.range = pImageView->get_subresource_range()
}, lastAccesses.get_barrier_mode(pImageView), !(dep.access & ResourceAccess::READ));
lastAccesses.update_access(pImageView, dep.access);
});
pass.for_each_buffer([&](const auto& pBuffer, const auto& dep) {
pBuffer->update_subresources(barrierInfo, {
.stageFlags = dep.stageFlags,
.accessMask = buffer_access_to_access_flags(dep.stageFlags, dep.access,
pBuffer->get_usage_flags()),
.offset = dep.offset,
.size = dep.size,
.queueFamilyIndex = g_renderContext->get_graphics_queue_family()
}, lastAccesses.get_barrier_mode(pBuffer), !(dep.access & ResourceAccess::READ));
lastAccesses.update_access(pBuffer, dep.access);
});
}
static VkAccessFlags image_access_to_access_flags(VkPipelineStageFlags stageFlags,
ResourceAccess::Enum access) {
VkAccessFlags result = {};
if (stageFlags & (VK_PIPELINE_STAGE_VERTEX_SHADER_BIT
| VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT)) {
result |= (((access & ResourceAccess::READ) != 0) * VK_ACCESS_SHADER_READ_BIT)
| (((access & ResourceAccess::WRITE) != 0) * VK_ACCESS_SHADER_WRITE_BIT);
}
if (stageFlags & (VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
| VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT)) {
result |= (((access & ResourceAccess::READ) != 0)
* VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT)
| (((access & ResourceAccess::WRITE) != 0)
* VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT);
}
if (stageFlags & VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT) {
result |= (((access & ResourceAccess::READ) != 0) * VK_ACCESS_COLOR_ATTACHMENT_READ_BIT)
| (((access & ResourceAccess::WRITE) != 0) * VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT);
}
if (stageFlags & VK_PIPELINE_STAGE_TRANSFER_BIT) {
result |= (((access & ResourceAccess::READ) != 0) * VK_ACCESS_TRANSFER_READ_BIT)
| (((access & ResourceAccess::WRITE) != 0) * VK_ACCESS_TRANSFER_WRITE_BIT);
}
return result;
}
static VkAccessFlags buffer_access_to_access_flags(VkPipelineStageFlags stageFlags,
ResourceAccess::Enum access, VkBufferUsageFlags usage) {
VkAccessFlags result = {};
if (stageFlags & VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT) {
result |= (((access & ResourceAccess::READ) != 0) * VK_ACCESS_INDIRECT_COMMAND_READ_BIT);
}
if (stageFlags & VK_PIPELINE_STAGE_VERTEX_INPUT_BIT) {
if (usage & VK_BUFFER_USAGE_INDEX_BUFFER_BIT) {
result |= (((access & ResourceAccess::READ) != 0) * VK_ACCESS_INDEX_READ_BIT);
}
if (usage & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT) {
result |= (((access & ResourceAccess::READ) != 0)
* VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT);
}
}
if (stageFlags & (VK_PIPELINE_STAGE_VERTEX_SHADER_BIT
| VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT)) {
result |= (((access & ResourceAccess::READ) != 0) * VK_ACCESS_SHADER_READ_BIT)
| (((access & ResourceAccess::WRITE) != 0) * VK_ACCESS_SHADER_WRITE_BIT);
}
if (stageFlags & VK_PIPELINE_STAGE_TRANSFER_BIT) {
result |= (((access & ResourceAccess::READ) != 0) * VK_ACCESS_TRANSFER_READ_BIT)
| (((access & ResourceAccess::WRITE) != 0) * VK_ACCESS_TRANSFER_WRITE_BIT);
}
return result;
}
|
whupdup/frame
|
src/graphics/frame_graph.cpp
|
C++
|
gpl-3.0
| 19,415
|
#pragma once
#include <graphics/framebuffer.hpp>
#include <graphics/frame_graph_pass.hpp>
#include <graphics/render_pass.hpp>
#include <memory>
namespace ZN::GFX {
class BarrierInfoCollection;
class CommandBuffer;
class FrameGraph final {
public:
class AccessTracker;
struct RenderPassData {
Memory::IntrusivePtr<RenderPass> renderPass;
Memory::IntrusivePtr<Framebuffer> framebuffer;
std::vector<VkClearValue> clearValues;
uint32_t startIndex;
uint32_t endIndex;
};
class RenderPassInterval final {
public:
explicit RenderPassInterval(uint32_t startIndex, uint32_t endIndex);
void register_pass(const FrameGraphPass&);
void increment_end_index();
void emit_barriers(AccessTracker&, BarrierInfoCollection&) const;
RenderPassData build();
uint32_t get_start_index() const;
uint32_t get_end_index() const;
const RenderPass::CreateInfo& get_create_info() const { return m_createInfo; }
RenderPass::AttachmentIndex_T get_color_attachment_index(
const Memory::IntrusivePtr<ImageView>&) const;
private:
uint32_t m_startIndex;
uint32_t m_endIndex;
std::vector<Memory::IntrusivePtr<ImageView>> m_colorAttachments;
Memory::IntrusivePtr<ImageView> m_depthAttachment;
std::vector<RenderPass::SubpassInfo> m_subpasses;
RenderPass::CreateInfo m_createInfo;
std::vector<VkClearValue> m_clearValues;
void register_color_attachment(const Memory::IntrusivePtr<ImageView>&, bool clear,
ResourceAccess::Enum access, RenderPass::AttachmentIndex_T* attachIndices,
RenderPass::AttachmentCount_T& attachCountInOut);
void emit_barriers_for_image(AccessTracker&, BarrierInfoCollection&,
const Memory::IntrusivePtr<ImageView>&, bool loadImage,
VkPipelineStageFlags, VkImageLayout, VkAccessFlags) const;
};
explicit FrameGraph() = default;
NULL_COPY_AND_ASSIGN(FrameGraph);
FrameGraphPass& add_pass(std::string name);
void build(CommandBuffer&);
std::vector<RenderPassInterval>& get_render_pass_intervals() {
return m_renderPassIntervals;
}
std::vector<RenderPassData>& get_render_passes() {
return m_renderPasses;
}
private:
std::vector<std::unique_ptr<FrameGraphPass>> m_passes;
std::vector<RenderPassInterval> m_renderPassIntervals;
std::vector<RenderPassData> m_renderPasses;
void print_raw_subpasses();
void merge_render_passes();
void build_barriers(std::vector<BarrierInfoCollection>&);
void build_physical_render_passes();
void emit_commands(CommandBuffer&, std::vector<BarrierInfoCollection>&);
bool can_swap_passes(uint32_t pI, uint32_t pJ) const;
bool can_merge_render_passes(const FrameGraphPass& pA, const FrameGraphPass& pB) const;
bool is_first_render_pass(uint32_t) const;
};
}
|
whupdup/frame
|
src/graphics/frame_graph.hpp
|
C++
|
gpl-3.0
| 2,769
|
#include "graphics/frame_graph_pass.hpp"
#include <graphics/frame_graph.hpp>
using namespace ZN;
using namespace ZN::GFX;
// Dependencies
void FrameGraphPass::TextureDependency::print(const ImageView& imageView) const {
printf("\t\t[texture] (%s) %s (M%u-%u, A%u-%u)\n", ResourceAccess::to_string(access),
imageView.get_name().c_str(), imageView.get_base_mip_level(),
imageView.get_base_mip_level() + imageView.get_level_count() - 1u,
imageView.get_base_array_layer(), imageView.get_base_array_layer()
+ imageView.get_layer_count() - 1u);
}
void FrameGraphPass::AttachmentDependency::print(const ImageView& imageView,
const char* type) const {
printf("\t\t[attach.%s] (%s) %s\n", type, ResourceAccess::to_string(access),
imageView.get_name().c_str());
}
void FrameGraphPass::BufferDependency::print(const Buffer& buffer) const {
printf("\t\t[buffer] (%s) %s\n", ResourceAccess::to_string(access),
buffer.get_name().c_str());
}
// FrameGraphPass
FrameGraphPass::FrameGraphPass(FrameGraph& graph, std::string name)
: m_graph(graph)
, m_name(std::move(name))
, m_commandCallback{}
, m_depthStencilImageView{} {}
FrameGraphPass& FrameGraphPass::add_color_attachment(ImageView& imageView,
ResourceAccess::Enum access) {
m_colorAttachments.emplace(std::make_pair(imageView.reference_from_this(),
AttachmentDependency{
.access = access,
.clear = false
}));
return *this;
}
FrameGraphPass& FrameGraphPass::add_cleared_color_attachment(ImageView& imageView,
ResourceAccess::Enum access, VkClearColorValue clearValue) {
m_colorAttachments.emplace(std::make_pair(imageView.reference_from_this(),
AttachmentDependency{
.clearValue = {.color = std::move(clearValue)},
.access = access,
.clear = true
}));
return *this;
}
FrameGraphPass& FrameGraphPass::add_depth_stencil_attachment(ImageView& imageView,
ResourceAccess::Enum access) {
m_depthStencilImageView = imageView.reference_from_this();
m_depthStencilInfo.access = access;
m_depthStencilInfo.clear = false;
return *this;
}
FrameGraphPass& FrameGraphPass::add_cleared_depth_stencil_attachment(ImageView& imageView,
ResourceAccess::Enum access, VkClearDepthStencilValue clearValue) {
m_depthStencilImageView = imageView.reference_from_this();
m_depthStencilInfo.clearValue.depthStencil = std::move(clearValue);
m_depthStencilInfo.access = access;
m_depthStencilInfo.clear = true;
return *this;
}
FrameGraphPass& FrameGraphPass::add_input_attachment(ImageView& imageView) {
m_inputAttachments.emplace(imageView.reference_from_this());
return *this;
}
FrameGraphPass& FrameGraphPass::add_texture(ImageView& res, ResourceAccess::Enum access,
VkPipelineStageFlags stageFlags, VkImageLayout layout) {
m_textures.emplace(std::make_pair(res.reference_from_this(), TextureDependency{
.stageFlags = stageFlags,
.layout = layout,
.access = access
}));
return *this;
}
FrameGraphPass& FrameGraphPass::add_buffer(Buffer& buffer, ResourceAccess::Enum access,
VkPipelineStageFlags stageFlags) {
m_buffers.emplace(std::make_pair(buffer.reference_from_this(), BufferDependency{
.stageFlags = stageFlags,
.access = access
}));
return *this;
}
void FrameGraphPass::write_commands(CommandBuffer& cmd) {
if (m_commandCallback) {
m_commandCallback(cmd);
}
}
bool FrameGraphPass::is_render_pass() const {
return !m_inputAttachments.empty() || !m_colorAttachments.empty() || m_depthStencilImageView;
}
bool FrameGraphPass::writes_resources_of_pass(const FrameGraphPass& other) const {
bool writes = false;
// FIXME: IterationDecision
other.for_each_touched_image_resource([&](auto& img) {
if (writes_image(img)) {
writes = true;
}
});
other.for_each_touched_buffer_resource([&](auto& buf) {
if (writes_buffer(buf)) {
writes = true;
}
});
return writes;
}
bool FrameGraphPass::writes_non_attachments_of_pass(const FrameGraphPass& other) const {
for (auto& [imageView, _] : other.m_textures) {
if (writes_image(imageView)) {
return true;
}
}
for (auto& [buffer, _] : other.m_buffers) {
if (writes_buffer(buffer)) {
return true;
}
}
return false;
}
bool FrameGraphPass::clears_attachments_of_pass(const FrameGraphPass& other) const {
if (m_depthStencilImageView && m_depthStencilInfo.clear
&& other.has_attachment(m_depthStencilImageView)) {
return true;
}
for (auto& [imageView, r] : m_colorAttachments) {
if (r.clear && other.has_attachment(imageView)) {
return true;
}
}
return false;
}
bool FrameGraphPass::writes_image(const Memory::IntrusivePtr<ImageView>& img) const {
if (m_depthStencilImageView.get() == img.get()
&& (m_depthStencilInfo.access & ResourceAccess::WRITE)) {
return true;
}
if (auto it = m_colorAttachments.find(img); it != m_colorAttachments.end()) {
return true;
}
if (auto it = m_textures.find(img); it != m_textures.end()
&& (it->second.access && ResourceAccess::WRITE)) {
return true;
}
return false;
}
bool FrameGraphPass::writes_buffer(const Memory::IntrusivePtr<Buffer>& buf) const {
if (auto it = m_buffers.find(buf); it != m_buffers.end()
&& (it->second.access & ResourceAccess::WRITE)) {
return true;
}
return false;
}
bool FrameGraphPass::has_attachment(const Memory::IntrusivePtr<ImageView>& img) const {
if (has_depth_attachment(img)) {
return true;
}
if (auto it = m_colorAttachments.find(img); it != m_colorAttachments.end()) {
return true;
}
return false;
}
bool FrameGraphPass::has_depth_attachment(const Memory::IntrusivePtr<ImageView>& img) const {
return m_depthStencilImageView.get() == img.get();
}
bool FrameGraphPass::has_depth_attachment() const {
return m_depthStencilImageView != nullptr;
}
void FrameGraphPass::set_render_pass_index(uint32_t renderPassIndex) {
m_renderPassIndex = renderPassIndex;
}
Memory::IntrusivePtr<ImageView> FrameGraphPass::get_depth_stencil_resource() const {
return m_depthStencilImageView;
}
const FrameGraphPass::AttachmentDependency& FrameGraphPass::get_depth_stencil_info() const {
return m_depthStencilInfo;
}
uint32_t FrameGraphPass::get_render_pass_index() const {
return m_renderPassIndex;
}
const std::string& FrameGraphPass::get_name() const {
return m_name;
}
void FrameGraphPass::print() const {
if (is_render_pass()) {
printf("\t[render] %s (RPI = %d)\n", m_name.c_str(), m_renderPassIndex);
}
else {
printf("\t[external] %s\n", m_name.c_str());
}
for (auto& [imageView, r] : m_colorAttachments) {
r.print(*imageView, "color");
}
if (m_depthStencilImageView) {
m_depthStencilInfo.print(*m_depthStencilImageView, "depth");
}
for (auto& imageView : m_inputAttachments) {
AttachmentDependency r{ResourceAccess::READ};
r.print(*imageView, "input");
}
for (auto& [imageView, r] : m_textures) {
r.print(*imageView);
}
for (auto& [buffer, r] : m_buffers) {
r.print(*buffer);
}
}
template <typename Functor>
void FrameGraphPass::for_each_touched_image_resource(Functor&& func) const {
for_each_touched_attachment_resource([&](auto& imageView) {
func(imageView);
});
for (auto& [imageView, _] : m_textures) {
func(imageView);
}
}
template <typename Functor>
void FrameGraphPass::for_each_touched_attachment_resource(Functor&& func) const {
if (m_depthStencilImageView) {
func(m_depthStencilImageView);
}
for (auto& [imageView, _] : m_colorAttachments) {
func(imageView);
}
for (auto& imageView : m_inputAttachments) {
func(imageView);
}
}
template <typename Functor>
void FrameGraphPass::for_each_touched_buffer_resource(Functor&& func) const {
for (auto& [buffer, _] : m_buffers) {
func(buffer);
}
}
|
whupdup/frame
|
src/graphics/frame_graph_pass.cpp
|
C++
|
gpl-3.0
| 7,613
|
#pragma once
#include <graphics/buffer.hpp>
#include <graphics/image_view.hpp>
#include <functional>
#include <vector>
#include <unordered_map>
#include <unordered_set>
namespace ZN::GFX {
class BarrierInfoCollection;
class CommandBuffer;
struct ResourceAccess {
enum Enum : uint8_t {
READ = 0b01,
WRITE = 0b10,
READ_WRITE = READ | WRITE
};
static constexpr const char* to_string(Enum value) {
switch (value) {
case READ:
return "R-";
case WRITE:
return "-W";
case READ_WRITE:
return "RW";
default:
break;
}
return "--";
}
};
class FrameGraph;
class FrameGraphPass final {
public:
static constexpr const uint32_t INVALID_RENDER_PASS_INDEX = ~0u;
struct TextureDependency {
VkPipelineStageFlags stageFlags;
VkImageLayout layout;
ResourceAccess::Enum access;
void print(const ImageView&) const;
};
struct AttachmentDependency {
VkClearValue clearValue;
ResourceAccess::Enum access;
bool clear;
void print(const ImageView&, const char* type) const;
};
struct BufferDependency {
VkPipelineStageFlags stageFlags;
ResourceAccess::Enum access;
VkDeviceSize offset;
VkDeviceSize size;
void print(const Buffer&) const;
};
explicit FrameGraphPass(FrameGraph& graph, std::string name);
NULL_COPY_AND_ASSIGN(FrameGraphPass);
FrameGraphPass& add_color_attachment(ImageView& imageView, ResourceAccess::Enum access);
FrameGraphPass& add_cleared_color_attachment(ImageView& imageView,
ResourceAccess::Enum access, VkClearColorValue clearValue);
FrameGraphPass& add_depth_stencil_attachment(ImageView& imageView,
ResourceAccess::Enum access);
FrameGraphPass& add_cleared_depth_stencil_attachment(ImageView& imageView,
ResourceAccess::Enum access, VkClearDepthStencilValue clearValue);
FrameGraphPass& add_input_attachment(ImageView& imageView);
FrameGraphPass& add_texture(ImageView& res, ResourceAccess::Enum access,
VkPipelineStageFlags stageFlags, VkImageLayout layout);
FrameGraphPass& add_buffer(Buffer& buffer, ResourceAccess::Enum access,
VkPipelineStageFlags stageFlags);
template <typename Functor>
FrameGraphPass& add_command_callback(Functor&& func) {
m_commandCallback = std::move(func);
return *this;
}
void write_commands(CommandBuffer&);
bool is_render_pass() const;
bool writes_resources_of_pass(const FrameGraphPass& other) const;
bool writes_non_attachments_of_pass(const FrameGraphPass& other) const;
bool clears_attachments_of_pass(const FrameGraphPass& other) const;
bool writes_image(const Memory::IntrusivePtr<ImageView>& img) const;
bool writes_buffer(const Memory::IntrusivePtr<Buffer>& buf) const;
bool has_attachment(const Memory::IntrusivePtr<ImageView>& img) const;
bool has_depth_attachment(const Memory::IntrusivePtr<ImageView>& img) const;
bool has_depth_attachment() const;
Memory::IntrusivePtr<ImageView> get_depth_stencil_resource() const;
const AttachmentDependency& get_depth_stencil_info() const;
void set_render_pass_index(uint32_t renderPassIndex);
uint32_t get_render_pass_index() const;
const std::string& get_name() const;
void print() const;
template <typename Functor>
void for_each_color_attachment(Functor&& func) const {
for (auto& [imageView, r] : m_colorAttachments) {
func(imageView, r);
}
}
template <typename Functor>
void for_each_input_attachment(Functor&& func) const {
for (auto& imageView : m_inputAttachments) {
func(imageView);
}
}
template <typename Functor>
void for_each_texture(Functor&& func) const {
for (auto& [imageView, r] : m_textures) {
func(imageView, r);
}
}
template <typename Functor>
void for_each_buffer(Functor&& func) const {
for (auto& [buffer, r] : m_buffers) {
func(buffer, r);
}
}
private:
FrameGraph& m_graph; // FIXME: unused
std::string m_name;
std::function<void(CommandBuffer&)> m_commandCallback;
std::unordered_map<Memory::IntrusivePtr<ImageView>, AttachmentDependency>
m_colorAttachments;
std::unordered_set<Memory::IntrusivePtr<ImageView>> m_inputAttachments;
std::unordered_map<Memory::IntrusivePtr<ImageView>, TextureDependency> m_textures;
std::unordered_map<Memory::IntrusivePtr<Buffer>, BufferDependency> m_buffers;
Memory::IntrusivePtr<ImageView> m_depthStencilImageView;
AttachmentDependency m_depthStencilInfo;
uint32_t m_renderPassIndex = INVALID_RENDER_PASS_INDEX;
template <typename Functor>
void for_each_touched_image_resource(Functor&& func) const;
template <typename Functor>
void for_each_touched_attachment_resource(Functor&& func) const;
template <typename Functor>
void for_each_touched_buffer_resource(Functor&& func) const;
};
}
|
whupdup/frame
|
src/graphics/frame_graph_pass.hpp
|
C++
|
gpl-3.0
| 4,745
|
#include "framebuffer.hpp"
#include <core/hash_builder.hpp>
#include <graphics/render_context.hpp>
#include <graphics/render_pass.hpp>
#include <unordered_map>
using namespace ZN;
using namespace ZN::GFX;
namespace ZN::GFX {
struct FramebufferKey {
uint64_t renderPass;
uint64_t attachmentIDs[RenderPass::MAX_COLOR_ATTACHMENTS + 1];
RenderPass::AttachmentCount_T attachmentCount;
explicit FramebufferKey(uint64_t renderPassID,
const std::vector<Memory::IntrusivePtr<ImageView>>& attachments)
: renderPass(renderPassID)
, attachmentCount(static_cast<RenderPass::AttachmentCount_T>(attachments.size())) {
for (size_t i = 0; i < attachments.size(); ++i) {
attachmentIDs[i] = attachments[i]->get_unique_id();
}
}
DEFAULT_COPY_AND_ASSIGN(FramebufferKey);
bool operator==(const FramebufferKey& other) const {
if (renderPass != other.renderPass || attachmentCount != other.attachmentCount) {
return false;
}
for (RenderPass::AttachmentCount_T i = 0; i < attachmentCount; ++i) {
if (attachmentIDs[i] != other.attachmentIDs[i]) {
return false;
}
}
return true;
}
};
struct FramebufferKeyHash {
uint64_t operator()(const FramebufferKey& key) const {
HashBuilder hb{};
hb.add_uint64(key.renderPass);
hb.add_uint32(static_cast<uint32_t>(key.attachmentCount));
for (RenderPass::AttachmentCount_T i = 0; i < key.attachmentCount; ++i) {
hb.add_uint64(key.attachmentIDs[i]);
}
return hb.get();
}
};
}
static std::unordered_map<FramebufferKey, Framebuffer*, FramebufferKeyHash> g_framebufferCache{};
static VkFramebuffer framebuffer_create(VkRenderPass renderPass,
const std::vector<Memory::IntrusivePtr<ImageView>>& attachments, uint32_t width,
uint32_t height);
Memory::IntrusivePtr<Framebuffer> Framebuffer::create(RenderPass& renderPass,
std::vector<Memory::IntrusivePtr<ImageView>> attachments, uint32_t width,
uint32_t height) {
FramebufferKey key(renderPass.get_unique_id(), attachments);
if (auto it = g_framebufferCache.find(key); it != g_framebufferCache.end()) {
return it->second->reference_from_this();
}
else {
auto framebuffer = framebuffer_create(renderPass, attachments, width, height);
if (framebuffer != VK_NULL_HANDLE) {
auto result = Memory::make_intrusive<Framebuffer>(framebuffer, std::move(attachments),
renderPass.get_unique_id(), width, height);
g_framebufferCache.emplace(std::make_pair(std::move(key), result.get()));
return result;
}
}
return nullptr;
}
Framebuffer::Framebuffer(VkFramebuffer framebuffer,
std::vector<Memory::IntrusivePtr<ImageView>> attachments, uint64_t renderPassID,
uint32_t width, uint32_t height)
: m_framebuffer(framebuffer)
, m_attachments(std::move(attachments))
, m_renderPassID(renderPassID)
, m_width(width)
, m_height(height) {}
Framebuffer::~Framebuffer() {
g_framebufferCache.erase(FramebufferKey{m_renderPassID, m_attachments});
}
Framebuffer::operator VkFramebuffer() const {
return m_framebuffer;
}
uint32_t Framebuffer::get_width() const {
return m_width;
}
uint32_t Framebuffer::get_height() const {
return m_height;
}
static VkFramebuffer framebuffer_create(VkRenderPass renderPass,
const std::vector<Memory::IntrusivePtr<ImageView>>& attachments, uint32_t width,
uint32_t height) {
VkImageView attachViews[RenderPass::MAX_COLOR_ATTACHMENTS + 1] = {};
for (size_t i = 0; i < attachments.size(); ++i) {
attachViews[i] = *attachments[i];
}
VkFramebuffer framebuffer{};
VkFramebufferCreateInfo createInfo{
.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,
.renderPass = renderPass,
.attachmentCount = static_cast<uint32_t>(attachments.size()),
.pAttachments = attachViews,
.width = width,
.height = height,
.layers = 1
};
if (vkCreateFramebuffer(g_renderContext->get_device(), &createInfo, nullptr, &framebuffer)
== VK_SUCCESS) {
return framebuffer;
}
return VK_NULL_HANDLE;
}
|
whupdup/frame
|
src/graphics/framebuffer.cpp
|
C++
|
gpl-3.0
| 3,915
|
#pragma once
#include <graphics/image_view.hpp>
namespace ZN::GFX {
class RenderPass;
class Framebuffer final : public Memory::IntrusivePtrEnabled<Framebuffer> {
public:
static Memory::IntrusivePtr<Framebuffer> create(RenderPass&,
std::vector<Memory::IntrusivePtr<ImageView>> attachments, uint32_t width,
uint32_t height);
explicit Framebuffer(VkFramebuffer, std::vector<Memory::IntrusivePtr<ImageView>>,
uint64_t renderPassID, uint32_t width, uint32_t height);
~Framebuffer();
NULL_COPY_AND_ASSIGN(Framebuffer);
operator VkFramebuffer() const;
uint32_t get_width() const;
uint32_t get_height() const;
private:
VkFramebuffer m_framebuffer;
std::vector<Memory::IntrusivePtr<ImageView>> m_attachments;
uint64_t m_renderPassID;
uint32_t m_width;
uint32_t m_height;
};
}
|
whupdup/frame
|
src/graphics/framebuffer.hpp
|
C++
|
gpl-3.0
| 815
|
#include "image.hpp"
#include <graphics/render_context.hpp>
using namespace ZN;
using namespace ZN::GFX;
Memory::IntrusivePtr<Image> Image::create(std::string name, uint32_t width, uint32_t height,
VkFormat format, VkSampleCountFlagBits sampleCount, uint32_t mipLevels,
uint32_t arrayLayers, bool swapchainImage) {
VkImage image{};
VkImageCreateInfo createInfo{
.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,
.imageType = VK_IMAGE_TYPE_2D,
.format = format,
.extent = {width, height, 1},
.mipLevels = mipLevels,
.arrayLayers = arrayLayers,
.samples = sampleCount
};
if (vkCreateImage(g_renderContext->get_device(), &createInfo, nullptr, &image) == VK_SUCCESS) {
return Memory::make_intrusive<Image>(std::move(name), image, width, height, format,
sampleCount, mipLevels, arrayLayers, swapchainImage);
}
return nullptr;
}
Image::Image(std::string name, VkImage image, uint32_t width, uint32_t height, VkFormat format,
VkSampleCountFlagBits sampleCount, uint32_t mipLevels, uint32_t arrayLayers,
bool swapchainImage)
: m_name(std::move(name))
, m_image(image)
, m_extent{width, height, 1}
, m_format(format)
, m_sampleCount(sampleCount)
, m_levelCount(mipLevels)
, m_layerCount(arrayLayers)
, m_swapchainImage(swapchainImage) {}
void Image::update_subresources(BarrierInfoCollection& barrierInfo,
const ImageResourceTracker::ResourceInfo& range,
ImageResourceTracker::BarrierMode barrierMode, bool ignorePreviousState) {
m_resourceTracker.update_range(m_image, barrierInfo, range, barrierMode, ignorePreviousState);
}
const std::string& Image::get_name() const {
return m_name;
}
VkImage Image::get_image() const {
return m_image;
}
const VkExtent3D& Image::get_extent() const {
return m_extent;
}
VkFormat Image::get_format() const {
return m_format;
}
VkSampleCountFlagBits Image::get_sample_count() const {
return m_sampleCount;
}
bool Image::is_swapchain_image() const {
return m_swapchainImage;
}
ImageResourceTracker& Image::get_resource_tracker() {
return m_resourceTracker;
}
const ImageResourceTracker& Image::get_resource_tracker() const {
return m_resourceTracker;
}
|
whupdup/frame
|
src/graphics/image.cpp
|
C++
|
gpl-3.0
| 2,156
|
#pragma once
#include <core/intrusive_ptr.hpp>
#include <graphics/image_resource_tracker.hpp>
#include <graphics/unique_graphics_object.hpp>
#include <string>
namespace ZN::GFX {
class Image final : public Memory::IntrusivePtrEnabled<Image>, public UniqueGraphicsObject {
public:
static Memory::IntrusivePtr<Image> create(std::string name, uint32_t width,
uint32_t height, VkFormat format,
VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_1_BIT, uint32_t mipLevels = 1,
uint32_t arrayLayers = 1, bool swapchainImage = false);
explicit Image(std::string name, VkImage image, uint32_t width, uint32_t height,
VkFormat format, VkSampleCountFlagBits sampleCount, uint32_t mipLevels,
uint32_t arrayLayers, bool swapchainImage);
NULL_COPY_AND_ASSIGN(Image);
void update_subresources(BarrierInfoCollection& barrierInfo,
const ImageResourceTracker::ResourceInfo& range,
ImageResourceTracker::BarrierMode barrierMode, bool ignorePreviousState);
const std::string& get_name() const;
VkImage get_image() const;
const VkExtent3D& get_extent() const;
VkFormat get_format() const;
VkSampleCountFlagBits get_sample_count() const;
bool is_swapchain_image() const;
ImageResourceTracker& get_resource_tracker();
const ImageResourceTracker& get_resource_tracker() const;
private:
std::string m_name;
VkImage m_image;
ImageResourceTracker m_resourceTracker;
VkExtent3D m_extent;
VkFormat m_format;
VkSampleCountFlagBits m_sampleCount;
uint32_t m_levelCount;
uint32_t m_layerCount;
bool m_swapchainImage;
};
}
|
whupdup/frame
|
src/graphics/image.hpp
|
C++
|
gpl-3.0
| 1,577
|
#include "image_resource_tracker.hpp"
#include <graphics/barrier_info_collection.hpp>
#include <cstdio>
using namespace ZN;
using namespace ZN::GFX;
static bool ranges_intersect(const VkImageSubresourceRange& a, const VkImageSubresourceRange& b);
// A fully covers B
static bool range_fully_covers(const VkImageSubresourceRange& a, const VkImageSubresourceRange& b);
// ResourceInfo
bool ImageResourceTracker::ResourceInfo::states_equal(const ResourceInfo& other) const {
return stageFlags == other.stageFlags && layout == other.layout
&& accessMask == other.accessMask && queueFamilyIndex == other.queueFamilyIndex;
}
bool ImageResourceTracker::ResourceInfo::intersects(const ResourceInfo& other) const {
return ranges_intersect(range, other.range);
}
bool ImageResourceTracker::ResourceInfo::fully_covers(const ResourceInfo& other) const {
return range_fully_covers(range, other.range);
}
// ImageResourceTracker
void ImageResourceTracker::update_range(VkImage image, BarrierInfoCollection& barrierInfo,
const ResourceInfo& rangeIn, BarrierMode barrierMode, bool ignorePreviousState) {
insert_range_internal(image, rangeIn, barrierInfo, barrierMode, ignorePreviousState);
union_ranges();
//print_ranges();
}
void ImageResourceTracker::print_ranges() {
puts("NEW STATES:");
for (auto& info : m_ranges) {
printf("\t{l=%d, qf=%u, a=0x%X, {M%u-%u, A%u-%u}}\n", info.layout, info.queueFamilyIndex,
info.accessMask, info.range.baseMipLevel,
info.range.baseMipLevel + info.range.levelCount - 1u, info.range.baseArrayLayer,
info.range.baseArrayLayer + info.range.layerCount - 1u);
}
}
size_t ImageResourceTracker::get_range_count() const {
return m_ranges.size();
}
bool ImageResourceTracker::has_overlapping_ranges() const {
for (size_t i = 0, l = m_ranges.size(); i < l; ++i) {
auto& a = m_ranges[i];
for (size_t j = i + 1; j < l; ++j) {
auto& b = m_ranges[j];
if (a.intersects(b)) {
return true;
}
}
}
return false;
}
bool ImageResourceTracker::has_range(const ResourceInfo& rangeIn) const {
for (auto& range : m_ranges) {
if (range.states_equal(rangeIn) && range.fully_covers(rangeIn)
&& rangeIn.fully_covers(range)) {
return true;
}
}
return false;
}
void ImageResourceTracker::insert_range_internal(VkImage image, const ResourceInfo& rangeIn,
BarrierInfoCollection& barrierInfo, BarrierMode barrierMode, bool ignorePreviousState,
bool generateLastBarrier) {
bool insertRangeIn = true;
if (!m_ranges.empty()) {
for (size_t i = m_ranges.size() - 1;; --i) {
auto& range = m_ranges[i];
auto statesEqual = range.states_equal(rangeIn);
bool needsQFOT = !ignorePreviousState
&& range.queueFamilyIndex != rangeIn.queueFamilyIndex;
printf("Needs QFOT? %s\n", needsQFOT ? "true" : "false");
if (range.fully_covers(rangeIn) && (statesEqual || needsQFOT)) {
// CASE 1: `rangeIn` is entirely covered by `range`, and states are equal, meaning
// no alternations need to be made to the range list
if (needsQFOT) {
add_barrier(image, barrierInfo, range, rangeIn, range.range,
ignorePreviousState);
range.queueFamilyIndex = rangeIn.queueFamilyIndex;
}
else if (barrierMode == BarrierMode::ALWAYS) {
add_barrier(image, barrierInfo, range, rangeIn, rangeIn.range,
ignorePreviousState);
}
return;
}
else if (rangeIn.fully_covers(range) && (ignorePreviousState || statesEqual)) {
// CASE 2: input range fully covers existing range, therefore remove it.
// This case is only valid if `rangeIn` can supersede the previous value
if (barrierMode == BarrierMode::ALWAYS) {
add_barrier(image, barrierInfo, range, rangeIn, std::move(range.range),
ignorePreviousState);
generateLastBarrier = false;
}
m_ranges[i] = std::move(m_ranges.back());
m_ranges.pop_back();
}
else if (rangeIn.intersects(range)) {
// CASE 3: input range partially covers existing range, generate difference
// between the 2 ranges. If there is a barrier of interest, it will be on
// the intersection of both
//puts("CASE 3");
// CASE 3a: Needs QFOT, entire source range must be transitioned
if (needsQFOT && !rangeIn.fully_covers(range)) {
puts("CASE 3a");
add_barrier(image, barrierInfo, range, rangeIn, range.range, false);
generate_range_difference(rangeIn, range, image, barrierInfo, barrierMode,
ignorePreviousState, generateLastBarrier);
range.queueFamilyIndex = rangeIn.queueFamilyIndex;
generateLastBarrier = false;
insertRangeIn = false;
}
else {
auto rangeCopy = std::move(range);
m_ranges[i] = std::move(m_ranges.back());
m_ranges.pop_back();
bool needsUniqueBarriers = barrierMode == BarrierMode::ALWAYS || !statesEqual;
if (needsUniqueBarriers && barrierMode != BarrierMode::NEVER) {
auto oldState = make_range_intersection(rangeCopy, rangeIn);
add_barrier(image, barrierInfo, oldState, rangeIn,
std::move(oldState.range), ignorePreviousState);
}
//puts("Emitting range difference of src range");
generate_range_difference(rangeCopy, rangeIn, image, barrierInfo, barrierMode,
ignorePreviousState, false);
if (!ignorePreviousState) {
if (needsUniqueBarriers) {
//puts("Emitting range difference of rangeIn");
generate_range_difference(rangeIn, rangeCopy, image, barrierInfo,
barrierMode, ignorePreviousState, generateLastBarrier);
m_ranges.emplace_back(make_range_intersection(rangeIn, rangeCopy));
return;
}
generateLastBarrier = false;
}
}
}
if (i == 0) {
break;
}
}
}
if (insertRangeIn) {
m_ranges.push_back(rangeIn);
}
// Range inserted here has no intersections, therefore is always src = UNDEFINED
if (generateLastBarrier && barrierMode != BarrierMode::NEVER) {
//puts("GENERATING FINAL BARRIER");
VkImageMemoryBarrier barrier{
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.srcAccessMask = 0,
.dstAccessMask = rangeIn.accessMask,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = rangeIn.layout,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = image,
.subresourceRange = std::move(rangeIn.range)
};
barrierInfo.add_image_memory_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
rangeIn.stageFlags, 0, std::move(barrier));
}
}
void ImageResourceTracker::generate_range_difference(const ResourceInfo& a, const ResourceInfo& b,
VkImage image, BarrierInfoCollection& barrierInfo, BarrierMode barrierMode,
bool ignorePreviousState, bool generateLastBarrier) {
auto aMinX = a.range.baseMipLevel;
auto aMaxX = a.range.baseMipLevel + a.range.levelCount;
auto aMinY = a.range.baseArrayLayer;
auto aMaxY = a.range.baseArrayLayer + a.range.layerCount;
auto bMinX = b.range.baseMipLevel;
auto bMaxX = b.range.baseMipLevel + b.range.levelCount;
auto bMinY = b.range.baseArrayLayer;
auto bMaxY = b.range.baseArrayLayer + b.range.layerCount;
auto sideMinY = aMinY;
auto sideMaxY = aMaxY;
printf("Range diff: {%u, %u, %u, %u} / {%u, %u, %u, %u}\n", aMinX, aMinY, aMaxX, aMaxY,
bMinX, bMinY, bMaxX, bMaxY);
if (aMinY < bMinY) {
puts("Generate range difference: case 1");
insert_range_like(a, image, barrierInfo, barrierMode, ignorePreviousState,
generateLastBarrier, aMinX, aMinY, aMaxX, bMinY);
sideMinY = bMinY;
}
if (bMaxY < aMaxY) {
puts("Generate range difference: case 2");
insert_range_like(a, image, barrierInfo, barrierMode, ignorePreviousState,
generateLastBarrier, aMinX, bMaxY, aMaxX, aMaxY);
sideMaxY = bMaxY;
}
if (aMinX < bMinX) {
printf("Generate range difference: case 3 {%u, %u, %u, %u}\n", aMinX, sideMinY,
bMinX, sideMaxY);
insert_range_like(a, image, barrierInfo, barrierMode, ignorePreviousState,
generateLastBarrier, aMinX, sideMinY, bMinX, sideMaxY);
}
if (bMaxX < aMaxX) {
printf("Generate range difference: case 4 {%u, %u, %u, %u}\n",
bMaxX, sideMinY, aMaxX, sideMaxY);
insert_range_like(a, image, barrierInfo, barrierMode, ignorePreviousState,
generateLastBarrier, bMaxX, sideMinY, aMaxX, sideMaxY);
}
}
void ImageResourceTracker::insert_range_like(const ResourceInfo& info, VkImage image,
BarrierInfoCollection& barrierInfo, BarrierMode barrierMode, bool ignorePreviousState,
bool generateLastBarrier, uint32_t minX, uint32_t minY, uint32_t maxX, uint32_t maxY) {
insert_range_internal(image, create_range_like(info, minX, minY, maxX, maxY), barrierInfo,
barrierMode, ignorePreviousState, generateLastBarrier);
}
void ImageResourceTracker::union_ranges() {
bool foundUnion = false;
do {
foundUnion = false;
for (size_t i = 0; i < m_ranges.size(); ++i) {
auto& a = m_ranges[i];
for (size_t j = i + 1; j < m_ranges.size(); ++j) {
auto& b = m_ranges[j];
if (!a.states_equal(b)) {
continue;
}
auto aMinX = a.range.baseMipLevel;
auto aMaxX = a.range.baseMipLevel + a.range.levelCount;
auto aMinY = a.range.baseArrayLayer;
auto aMaxY = a.range.baseArrayLayer + a.range.layerCount;
auto bMinX = b.range.baseMipLevel;
auto bMaxX = b.range.baseMipLevel + b.range.levelCount;
auto bMinY = b.range.baseArrayLayer;
auto bMaxY = b.range.baseArrayLayer + b.range.layerCount;
if (aMinX == bMinX && aMaxX == bMaxX) {
if (aMaxY == bMinY) {
foundUnion = true;
//puts("Union case 1");
a.range.layerCount = bMaxY - aMinY;
}
else if (aMinY == bMaxY) {
foundUnion = true;
//puts("Union case 2");
a.range.baseArrayLayer = bMinY;
a.range.layerCount = aMaxY - bMinY;
}
}
else if (aMinY == bMinY && aMaxY == bMaxY) {
if (aMaxX == bMinX) {
foundUnion = true;
//printf("Union case 3 {%u, %u, %u, %u} U {%u, %u, %u, %u}\n",
// aMinX, aMinY, aMaxX, aMaxY, bMinX, bMinY, bMaxX, bMaxY);
a.range.levelCount = bMaxX - aMinX;
}
else if (aMinX == bMaxX) {
foundUnion = true;
//puts("Union case 4");
a.range.baseMipLevel = bMinX;
a.range.levelCount = aMaxX - bMinX;
}
}
if (foundUnion) {
m_ranges[j] = std::move(m_ranges.back());
m_ranges.pop_back();
break;
}
}
if (foundUnion) {
break;
}
}
}
while (foundUnion);
}
ImageResourceTracker::ResourceInfo ImageResourceTracker::create_range_like(
const ResourceInfo& info, uint32_t minX, uint32_t minY, uint32_t maxX, uint32_t maxY) {
return {
.stageFlags = info.stageFlags,
.layout = info.layout,
.accessMask = info.accessMask,
.queueFamilyIndex = info.queueFamilyIndex,
.range = {
.aspectMask = info.range.aspectMask,
.baseMipLevel = minX,
.levelCount = maxX - minX,
.baseArrayLayer = minY,
.layerCount = maxY - minY
}
};
}
void ImageResourceTracker::add_barrier(VkImage image, BarrierInfoCollection& barrierInfo,
const ResourceInfo& from, const ResourceInfo& to, VkImageSubresourceRange range,
bool ignorePreviousState) {
VkImageMemoryBarrier barrier{
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.srcAccessMask = ignorePreviousState ? 0 : from.accessMask,
.dstAccessMask = to.accessMask,
.oldLayout = ignorePreviousState ? VK_IMAGE_LAYOUT_UNDEFINED : from.layout,
.newLayout = to.layout,
.srcQueueFamilyIndex = from.queueFamilyIndex,
.dstQueueFamilyIndex = to.queueFamilyIndex,
.image = image,
.subresourceRange = std::move(range)
};
if (barrier.srcQueueFamilyIndex == barrier.dstQueueFamilyIndex) {
barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
}
printf("add_barrier: {s=%X d=%X o=%u n=%u sq=%d dq=%d {%u %u %u %u}}\n",
barrier.srcAccessMask, barrier.dstAccessMask, barrier.oldLayout, barrier.newLayout,
barrier.srcQueueFamilyIndex, barrier.dstQueueFamilyIndex,
barrier.subresourceRange.baseMipLevel, barrier.subresourceRange.levelCount,
barrier.subresourceRange.baseArrayLayer, barrier.subresourceRange.layerCount);
barrierInfo.add_image_memory_barrier(from.stageFlags, to.stageFlags,
0 /* FIXME: figure out how to pass dependency flags */, std::move(barrier));
}
ImageResourceTracker::ResourceInfo ImageResourceTracker::make_range_intersection(
const ResourceInfo& a, const ResourceInfo& b) {
auto aMinX = a.range.baseMipLevel;
auto aMaxX = a.range.baseMipLevel + a.range.levelCount;
auto aMinY = a.range.baseArrayLayer;
auto aMaxY = a.range.baseArrayLayer + a.range.layerCount;
auto bMinX = b.range.baseMipLevel;
auto bMaxX = b.range.baseMipLevel + b.range.levelCount;
auto bMinY = b.range.baseArrayLayer;
auto bMaxY = b.range.baseArrayLayer + b.range.layerCount;
auto minX = aMinX > bMinX ? aMinX : bMinX;
auto minY = aMinY > bMinY ? aMinY : bMinY;
auto maxX = aMaxX < bMaxX ? aMaxX : bMaxX;
auto maxY = aMaxY < bMaxY ? aMaxY : bMaxY;
return {
.stageFlags = a.stageFlags,
.layout = a.layout,
.accessMask = a.accessMask,
.queueFamilyIndex = a.queueFamilyIndex,
.range = {
.aspectMask = a.range.aspectMask,
.baseMipLevel = minX,
.levelCount = maxX - minX,
.baseArrayLayer = minY,
.layerCount = maxY - minY
}
};
}
static bool ranges_intersect(const VkImageSubresourceRange& a, const VkImageSubresourceRange& b) {
return (a.baseMipLevel < b.baseMipLevel + b.levelCount
&& a.baseMipLevel + a.levelCount > b.baseMipLevel)
&& (a.baseArrayLayer < b.baseArrayLayer + b.layerCount
&& a.baseArrayLayer + a.layerCount > b.baseArrayLayer);
}
// A fully covers B
static bool range_fully_covers(const VkImageSubresourceRange& a,
const VkImageSubresourceRange& b) {
return b.baseMipLevel >= a.baseMipLevel
&& b.baseMipLevel + b.levelCount <= a.baseMipLevel + a.levelCount
&& b.baseArrayLayer >= a.baseArrayLayer
&& b.baseArrayLayer + b.layerCount <= a.baseArrayLayer + a.layerCount;
}
|
whupdup/frame
|
src/graphics/image_resource_tracker.cpp
|
C++
|
gpl-3.0
| 13,901
|
#pragma once
#include <vulkan.h>
#include <vector>
namespace ZN::GFX {
class BarrierInfoCollection;
class ImageResourceTracker final {
public:
struct ResourceInfo {
VkPipelineStageFlags stageFlags;
VkImageLayout layout;
VkAccessFlags accessMask;
uint32_t queueFamilyIndex;
VkImageSubresourceRange range;
bool states_equal(const ResourceInfo& other) const;
bool intersects(const ResourceInfo& other) const;
bool fully_covers(const ResourceInfo& other) const;
};
enum class BarrierMode {
TRANSITIONS_ONLY,
ALWAYS,
NEVER
};
void update_range(VkImage image, BarrierInfoCollection& barrierInfo,
const ResourceInfo& rangeIn, BarrierMode barrierMode, bool ignorePreviousState);
void print_ranges();
size_t get_range_count() const;
bool has_overlapping_ranges() const;
bool has_range(const ResourceInfo& rangeIn) const;
private:
std::vector<ResourceInfo> m_ranges;
void insert_range_internal(VkImage image, const ResourceInfo& rangeIn,
BarrierInfoCollection& barrierInfo, BarrierMode barrierMode,
bool ignorePreviousState, bool generateLastBarrier = true);
// Emits ranges that are pieces of A if B was subtracted from it, meaning the resulting
// ranges include none of B's coverage
void generate_range_difference(const ResourceInfo& a, const ResourceInfo& b, VkImage image,
BarrierInfoCollection& barrierInfo, BarrierMode barrierMode,
bool ignorePreviousState, bool generateLastBarrier);
void insert_range_like(const ResourceInfo& info, VkImage image,
BarrierInfoCollection& barrierInfo, BarrierMode barrierMode,
bool ignorePreviousState, bool generateLastBarrier, uint32_t minX, uint32_t minY,
uint32_t maxX, uint32_t maxY);
void union_ranges();
static ResourceInfo create_range_like(const ResourceInfo& info, uint32_t minX,
uint32_t minY, uint32_t maxX, uint32_t maxY);
static void add_barrier(VkImage image, BarrierInfoCollection& barrierInfo,
const ResourceInfo& from, const ResourceInfo& to, VkImageSubresourceRange range,
bool ignorePreviousState);
static ResourceInfo make_range_intersection(const ResourceInfo& a, const ResourceInfo& b);
};
}
|
whupdup/frame
|
src/graphics/image_resource_tracker.hpp
|
C++
|
gpl-3.0
| 2,176
|
#include "image_view.hpp"
using namespace ZN;
using namespace ZN::GFX;
Memory::IntrusivePtr<ImageView> ImageView::create(Image& image, VkImageSubresourceRange range) {
return Memory::make_intrusive<ImageView>(image, std::move(range));
}
ImageView::ImageView(Image& image, VkImageSubresourceRange range)
: m_image(image.reference_from_this())
, m_range(std::move(range)) {}
const std::string& ImageView::get_name() const {
return m_image->get_name();
}
ImageView::operator VkImageView() const {
return m_imageView;
}
Image& ImageView::get_image() const {
return *m_image;
}
const VkImageSubresourceRange& ImageView::get_subresource_range() const {
return m_range;
}
bool ImageView::is_swapchain_image() const {
return m_image->is_swapchain_image();
}
uint32_t ImageView::get_base_mip_level() const {
return m_range.baseMipLevel;
}
uint32_t ImageView::get_base_array_layer() const {
return m_range.baseArrayLayer;
}
uint32_t ImageView::get_level_count() const {
return m_range.levelCount;
}
uint32_t ImageView::get_layer_count() const {
return m_range.layerCount;
}
|
whupdup/frame
|
src/graphics/image_view.cpp
|
C++
|
gpl-3.0
| 1,091
|
#pragma once
#include <graphics/image.hpp>
#include <vulkan.h>
namespace ZN::GFX {
class ImageView final : public Memory::IntrusivePtrEnabled<ImageView>,
public UniqueGraphicsObject {
public:
static Memory::IntrusivePtr<ImageView> create(Image& image, VkImageSubresourceRange range);
explicit ImageView(Image& image, VkImageSubresourceRange range);
NULL_COPY_AND_ASSIGN(ImageView);
const std::string& get_name() const;
operator VkImageView() const;
Image& get_image() const;
const VkImageSubresourceRange& get_subresource_range() const;
bool is_swapchain_image() const;
uint32_t get_base_mip_level() const;
uint32_t get_base_array_layer() const;
uint32_t get_level_count() const;
uint32_t get_layer_count() const;
private:
VkImageView m_imageView;
Memory::IntrusivePtr<Image> m_image;
VkImageSubresourceRange m_range;
};
}
|
whupdup/frame
|
src/graphics/image_view.hpp
|
C++
|
gpl-3.0
| 869
|
#pragma once
#include <core/local.hpp>
#include <graphics/image_view.hpp>
namespace ZN::GFX {
class RenderContext final {
public:
uint32_t get_graphics_queue_family() const {
return 0;
}
VkDevice get_device() const {
return nullptr;
}
Image& get_swapchain_image() {
return *m_swapchainImage;
}
ImageView& get_swapchain_image_view() {
return *m_swapchain;
}
private:
Memory::IntrusivePtr<Image> m_swapchainImage = Image::create("swapchain", 1200, 800,
VK_FORMAT_R8G8B8A8_UNORM, VK_SAMPLE_COUNT_1_BIT, 1, 1, true);
Memory::IntrusivePtr<ImageView> m_swapchain = ImageView::create(*m_swapchainImage,
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
};
inline Local<RenderContext> g_renderContext = {};
}
|
whupdup/frame
|
src/graphics/render_context.hpp
|
C++
|
gpl-3.0
| 745
|
#include "render_pass.hpp"
#include <core/hash_builder.hpp>
#include <core/memory.hpp>
#include <graphics/render_context.hpp>
#include <cassert>
#include <vector>
#include <unordered_map>
using namespace ZN;
using namespace ZN::GFX;
namespace {
struct RenderPassCreateInfoHash {
size_t operator()(const RenderPass::CreateInfo&) const;
};
struct RenderPassContainer {
Memory::IntrusivePtr<RenderPass> renderPass;
Memory::UniquePtr<RenderPass::SubpassInfo[]> subpassInfo;
};
struct DependencyList {
std::unordered_map<uint64_t, size_t> lookup;
std::vector<VkSubpassDependency> dependencies;
};
}
static std::unordered_map<RenderPass::CreateInfo, RenderPassContainer, RenderPassCreateInfoHash>
g_renderPassCache = {};
static VkRenderPass render_pass_create(const RenderPass::CreateInfo& createInfo);
static bool has_depth_attachment(const RenderPass::CreateInfo& createInfo);
Memory::IntrusivePtr<RenderPass> RenderPass::create(const RenderPass::CreateInfo& createInfo) {
if (auto it = g_renderPassCache.find(createInfo); it != g_renderPassCache.end()) {
return it->second.renderPass;
}
else {
auto renderPass = render_pass_create(createInfo);
if (renderPass == VK_NULL_HANDLE) {
return {};
}
auto ownedCreateInfo = createInfo;
auto ownedSubpassInfo = std::make_unique<SubpassInfo[]>(createInfo.subpassCount);
ownedCreateInfo.pSubpasses = ownedSubpassInfo.get();
memcpy(ownedSubpassInfo.get(), createInfo.pSubpasses,
static_cast<size_t>(createInfo.subpassCount) * sizeof(SubpassInfo));
Memory::IntrusivePtr result(new RenderPass(renderPass));
g_renderPassCache.emplace(std::make_pair(std::move(ownedCreateInfo),
RenderPassContainer{result, std::move(ownedSubpassInfo)}));
return result;
}
}
RenderPass::RenderPass(VkRenderPass renderPass)
: m_renderPass(renderPass) {}
RenderPass::operator VkRenderPass() const {
return m_renderPass;
}
VkRenderPass RenderPass::get_render_pass() const {
return m_renderPass;
}
static VkAttachmentLoadOp get_load_op(RenderPass::AttachmentBitMask_T clearMask,
RenderPass::AttachmentBitMask_T loadMask, uint8_t index) {
if ((clearMask >> index) & 1) {
return VK_ATTACHMENT_LOAD_OP_CLEAR;
}
else if ((loadMask >> index) & 1) {
return VK_ATTACHMENT_LOAD_OP_LOAD;
}
else {
return VK_ATTACHMENT_LOAD_OP_DONT_CARE;
}
}
static VkImageLayout get_color_initial_layout(const RenderPass::CreateInfo& createInfo,
RenderPass::AttachmentCount_T index) {
if ((createInfo.loadAttachmentMask >> index) & 1) {
return ((createInfo.swapchainAttachmentMask >> index) & 1)
? VK_IMAGE_LAYOUT_PRESENT_SRC_KHR : VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
}
else {
return VK_IMAGE_LAYOUT_UNDEFINED;
}
}
static VkImageLayout get_color_final_layout(const RenderPass::CreateInfo& createInfo,
RenderPass::AttachmentCount_T index) {
return ((createInfo.swapchainAttachmentMask >> index) & 1)
? VK_IMAGE_LAYOUT_PRESENT_SRC_KHR : VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
}
static VkImageLayout get_depth_initial_layout(const RenderPass::CreateInfo& createInfo) {
return (createInfo.createFlags & RenderPass::CREATE_FLAG_LOAD_DEPTH_STENCIL)
? VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
: VK_IMAGE_LAYOUT_UNDEFINED;
}
static void build_attachment_descriptions(const RenderPass::CreateInfo& createInfo,
VkAttachmentDescription* attachDescs, bool hasDepthAttach) {
assert(!(createInfo.clearAttachmentMask & createInfo.loadAttachmentMask));
for (RenderPass::AttachmentCount_T i = 0; i < createInfo.colorAttachmentCount; ++i) {
auto& ai = createInfo.colorAttachments[i];
attachDescs[i] = {
.format = ai.format,
.samples = ai.samples,
.loadOp = get_load_op(createInfo.clearAttachmentMask, createInfo.loadAttachmentMask,
i),
.storeOp = ((createInfo.storeAttachmentMask >> i) & 1) ? VK_ATTACHMENT_STORE_OP_STORE
: VK_ATTACHMENT_STORE_OP_DONT_CARE,
.stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE,
.stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE,
.initialLayout = get_color_initial_layout(createInfo, i),
.finalLayout = get_color_final_layout(createInfo, i)
};
}
if (hasDepthAttach) {
VkAttachmentLoadOp loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
VkAttachmentStoreOp storeOp = (createInfo.createFlags
& RenderPass::CREATE_FLAG_STORE_DEPTH_STENCIL)
? VK_ATTACHMENT_STORE_OP_STORE : VK_ATTACHMENT_STORE_OP_DONT_CARE;
if (createInfo.createFlags & RenderPass::CREATE_FLAG_CLEAR_DEPTH_STENCIL) {
loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
}
else if (createInfo.createFlags & RenderPass::CREATE_FLAG_LOAD_DEPTH_STENCIL) {
loadOp = VK_ATTACHMENT_LOAD_OP_LOAD;
}
attachDescs[createInfo.colorAttachmentCount] = {
.format = createInfo.depthAttachment.format,
.samples = createInfo.depthAttachment.samples,
.loadOp = loadOp,
.storeOp = storeOp,
.stencilLoadOp = loadOp,
.stencilStoreOp = storeOp,
.initialLayout = get_depth_initial_layout(createInfo),
.finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL
};
}
}
static const VkAttachmentReference* create_attach_ref_list(
const RenderPass::AttachmentIndex_T* indices, RenderPass::AttachmentCount_T count,
VkImageLayout layout, std::vector<std::vector<VkAttachmentReference>>& attachRefLists) {
std::vector<VkAttachmentReference> attachRefs(count);
for (RenderPass::AttachmentCount_T i = 0; i < count; ++i) {
attachRefs[i].attachment = indices[i];
attachRefs[i].layout = layout;
}
attachRefLists.emplace_back(std::move(attachRefs));
return attachRefLists.back().data();
}
static void build_subpass_descriptions(const RenderPass::CreateInfo& createInfo,
VkSubpassDescription* subpasses,
std::vector<std::vector<VkAttachmentReference>>& attachRefLists) {
RenderPass::AttachmentIndex_T depthIndex = createInfo.colorAttachmentCount;
for (uint8_t i = 0; i < createInfo.subpassCount; ++i) {
auto& sp = createInfo.pSubpasses[i];
switch (sp.depthStencilUsage) {
case RenderPass::DepthStencilUsage::READ:
subpasses[i].pDepthStencilAttachment = create_attach_ref_list(&depthIndex, 1,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, attachRefLists);
break;
case RenderPass::DepthStencilUsage::WRITE:
case RenderPass::DepthStencilUsage::READ_WRITE:
subpasses[i].pDepthStencilAttachment = create_attach_ref_list(&depthIndex, 1,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, attachRefLists);
break;
default:
break;
}
subpasses[i].inputAttachmentCount = static_cast<uint32_t>(sp.inputAttachmentCount);
if (sp.inputAttachmentCount > 0) {
subpasses[i].pInputAttachments = create_attach_ref_list(sp.inputAttachments,
sp.inputAttachmentCount, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
attachRefLists);
}
subpasses[i].colorAttachmentCount = static_cast<uint32_t>(sp.colorAttachmentCount);
if (sp.colorAttachmentCount > 0) {
subpasses[i].pColorAttachments = create_attach_ref_list(sp.colorAttachments,
sp.colorAttachmentCount, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
attachRefLists);
}
if (sp.resolveAttachmentCount > 0) {
subpasses[i].pResolveAttachments = create_attach_ref_list(sp.resolveAttachments,
sp.resolveAttachmentCount, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
attachRefLists);
}
}
}
static bool subpass_has_color_attachment(const RenderPass::SubpassInfo& subpass,
RenderPass::AttachmentIndex_T attachIndex) {
for (RenderPass::AttachmentCount_T i = 0; i < subpass.colorAttachmentCount; ++i) {
if (subpass.colorAttachments[i] == attachIndex) {
return true;
}
}
return false;
}
static bool subpass_has_resolve_attachment(const RenderPass::SubpassInfo& subpass,
RenderPass::AttachmentIndex_T attachIndex) {
for (RenderPass::AttachmentCount_T i = 0; i < subpass.resolveAttachmentCount; ++i) {
if (subpass.resolveAttachments[i] == attachIndex) {
return true;
}
}
return false;
}
static bool subpass_has_input_attachment(const RenderPass::SubpassInfo& subpass,
RenderPass::AttachmentIndex_T attachIndex) {
for (RenderPass::AttachmentCount_T i = 0; i < subpass.inputAttachmentCount; ++i) {
if (subpass.inputAttachments[i] == attachIndex) {
return true;
}
}
return false;
}
static void build_dependency(DependencyList& depList, uint8_t srcSubpass, uint8_t dstSubpass,
VkPipelineStageFlags srcStageMask, VkAccessFlags srcAccessMask,
VkPipelineStageFlags dstStageMask, VkAccessFlags dstAccessMask) {
auto key = static_cast<uint64_t>(srcSubpass) | (static_cast<uint64_t>(dstSubpass) << 8);
if (auto it = depList.lookup.find(key); it != depList.lookup.end()) {
auto& dep = depList.dependencies[it->second];
dep.srcStageMask |= srcStageMask;
dep.dstStageMask |= dstStageMask;
dep.srcAccessMask |= srcAccessMask;
dep.dstAccessMask |= dstAccessMask;
}
else {
depList.lookup.emplace(std::make_pair(key, depList.dependencies.size()));
depList.dependencies.push_back({
.srcSubpass = static_cast<uint32_t>(srcSubpass),
.dstSubpass = static_cast<uint32_t>(dstSubpass),
.srcStageMask = srcStageMask,
.dstStageMask = dstStageMask,
.srcAccessMask = srcAccessMask,
.dstAccessMask = dstAccessMask,
.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT
});
}
}
static void build_preceding_dependencies(const RenderPass::CreateInfo& createInfo,
DependencyList& depList, uint8_t dstSubpass, RenderPass::AttachmentIndex_T attachIndex,
VkPipelineStageFlags dstStageMask, VkAccessFlags dstAccessMask) {
for (uint8_t srcSubpass = 0; srcSubpass < dstSubpass; ++srcSubpass) {
auto& sp = createInfo.pSubpasses[srcSubpass];
if (attachIndex == createInfo.colorAttachmentCount) {
switch (sp.depthStencilUsage) {
case RenderPass::DepthStencilUsage::READ:
build_dependency(depList, srcSubpass, dstSubpass,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
| VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT, dstStageMask,
dstAccessMask);
break;
case RenderPass::DepthStencilUsage::WRITE:
build_dependency(depList, srcSubpass, dstSubpass,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
| VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, dstStageMask,
dstAccessMask);
break;
case RenderPass::DepthStencilUsage::READ_WRITE:
build_dependency(depList, srcSubpass, dstSubpass,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
| VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT
| VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT, dstStageMask,
dstAccessMask);
break;
default:
break;
}
}
else if (subpass_has_color_attachment(sp, attachIndex)
|| subpass_has_resolve_attachment(sp, attachIndex)) {
build_dependency(depList, srcSubpass, dstSubpass,
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
dstStageMask, dstAccessMask);
}
else if (subpass_has_input_attachment(sp, attachIndex)) {
build_dependency(depList, srcSubpass, dstSubpass,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT, dstStageMask,
dstAccessMask);
}
}
}
static void build_subpass_dependencies(const RenderPass::CreateInfo& createInfo,
DependencyList& depList) {
for (uint8_t subpassIndex = 1; subpassIndex < createInfo.subpassCount; ++subpassIndex) {
auto& sp = createInfo.pSubpasses[subpassIndex];
for (RenderPass::AttachmentCount_T i = 0; i < sp.colorAttachmentCount; ++i) {
build_preceding_dependencies(createInfo, depList, subpassIndex, sp.colorAttachments[i],
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT);
}
for (RenderPass::AttachmentCount_T i = 0; i < sp.inputAttachmentCount; ++i) {
build_preceding_dependencies(createInfo, depList, subpassIndex, sp.inputAttachments[i],
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_ACCESS_SHADER_READ_BIT);
}
for (RenderPass::AttachmentCount_T i = 0; i < sp.resolveAttachmentCount; ++i) {
build_preceding_dependencies(createInfo, depList, subpassIndex,
sp.resolveAttachments[i], VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT);
}
switch (sp.depthStencilUsage) {
case RenderPass::DepthStencilUsage::READ:
build_preceding_dependencies(createInfo, depList, subpassIndex,
createInfo.colorAttachmentCount,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
| VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT);
break;
case RenderPass::DepthStencilUsage::WRITE:
build_preceding_dependencies(createInfo, depList, subpassIndex,
createInfo.colorAttachmentCount,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
| VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT);
break;
case RenderPass::DepthStencilUsage::READ_WRITE:
build_preceding_dependencies(createInfo, depList, subpassIndex,
createInfo.colorAttachmentCount,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
| VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT
| VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT);
break;
default:
break;
}
}
}
static VkRenderPass render_pass_create(const RenderPass::CreateInfo& createInfo) {
VkRenderPass renderPass = VK_NULL_HANDLE;
auto hasDepthAttach = has_depth_attachment(createInfo);
VkAttachmentDescription attachDescs[RenderPass::MAX_COLOR_ATTACHMENTS + 1] = {};
std::vector<VkSubpassDescription> subpasses(createInfo.subpassCount);
std::vector<std::vector<VkAttachmentReference>> attachRefLists;
DependencyList dependencyList;
build_attachment_descriptions(createInfo, attachDescs, hasDepthAttach);
build_subpass_descriptions(createInfo, subpasses.data(), attachRefLists);
build_subpass_dependencies(createInfo, dependencyList);
VkRenderPassCreateInfo rpCreateInfo{
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
.attachmentCount = static_cast<uint32_t>(createInfo.colorAttachmentCount) + hasDepthAttach,
.pAttachments = attachDescs,
.subpassCount = static_cast<uint32_t>(createInfo.subpassCount),
.pSubpasses = subpasses.data(),
.dependencyCount = static_cast<uint32_t>(dependencyList.dependencies.size()),
.pDependencies = dependencyList.dependencies.empty() ? nullptr
: dependencyList.dependencies.data()
};
if (vkCreateRenderPass(g_renderContext->get_device(), &rpCreateInfo, nullptr, &renderPass)
== VK_SUCCESS) {
return renderPass;
}
return VK_NULL_HANDLE;
}
static bool has_depth_attachment(const RenderPass::CreateInfo& info) {
return info.createFlags & (RenderPass::CREATE_FLAG_CLEAR_DEPTH_STENCIL
| RenderPass::CREATE_FLAG_LOAD_DEPTH_STENCIL
| RenderPass::CREATE_FLAG_STORE_DEPTH_STENCIL);
}
bool RenderPass::AttachmentInfo::operator==(const AttachmentInfo& other) const {
return format == other.format && samples == other.samples;
}
bool RenderPass::AttachmentInfo::operator!=(const AttachmentInfo& other) const {
return !(*this == other);
}
bool RenderPass::SubpassInfo::operator==(const SubpassInfo& other) const {
if (colorAttachmentCount != other.colorAttachmentCount
|| inputAttachmentCount != other.inputAttachmentCount
|| resolveAttachmentCount != other.resolveAttachmentCount
|| depthStencilUsage != other.depthStencilUsage) {
return false;
}
for (RenderPass::AttachmentCount_T i = 0; i < colorAttachmentCount; ++i) {
if (colorAttachments[i] != other.colorAttachments[i]) {
return false;
}
}
for (RenderPass::AttachmentCount_T i = 0; i < inputAttachmentCount; ++i) {
if (inputAttachments[i] != other.inputAttachments[i]) {
return false;
}
}
for (RenderPass::AttachmentCount_T i = 0; i < resolveAttachmentCount; ++i) {
if (resolveAttachments[i] != other.resolveAttachments[i]) {
return false;
}
}
return true;
}
bool RenderPass::SubpassInfo::operator!=(const SubpassInfo& other) const {
return !(*this == other);
}
bool RenderPass::CreateInfo::operator==(const CreateInfo& other) const {
if (colorAttachmentCount != other.colorAttachmentCount
|| clearAttachmentMask != other.clearAttachmentMask
|| loadAttachmentMask != other.loadAttachmentMask
|| storeAttachmentMask != other.storeAttachmentMask
|| subpassCount != other.subpassCount || createFlags != other.createFlags) {
return false;
}
if (has_depth_attachment(*this) && depthAttachment != other.depthAttachment) {
return false;
}
for (RenderPass::AttachmentCount_T i = 0; i < colorAttachmentCount; ++i) {
if (colorAttachments[i] != other.colorAttachments[i]) {
return false;
}
}
for (uint8_t i = 0; i < subpassCount; ++i) {
if (pSubpasses[i] != other.pSubpasses[i]) {
return false;
}
}
return true;
}
size_t RenderPassCreateInfoHash::operator()(const RenderPass::CreateInfo& info) const {
HashBuilder hb{};
for (RenderPass::AttachmentCount_T i = 0; i < info.colorAttachmentCount; ++i) {
auto& attach = info.colorAttachments[i];
hb.add_uint32(static_cast<uint32_t>(attach.format));
hb.add_uint32(static_cast<uint32_t>(attach.samples));
}
if (has_depth_attachment(info)) {
hb.add_uint32(static_cast<uint32_t>(info.depthAttachment.format));
hb.add_uint32(static_cast<uint32_t>(info.depthAttachment.samples));
}
for (uint8_t i = 0; i < info.subpassCount; ++i) {
auto& subpass = info.pSubpasses[i];
hb.add_uint32(static_cast<uint32_t>(subpass.colorAttachmentCount)
| (static_cast<uint32_t>(subpass.inputAttachmentCount) << 8)
| (static_cast<uint32_t>(subpass.resolveAttachmentCount) << 16)
| (static_cast<uint32_t>(subpass.depthStencilUsage) << 24));
}
hb.add_uint32(static_cast<uint32_t>(info.colorAttachmentCount)
| (static_cast<uint32_t>(info.clearAttachmentMask) << 8)
| (static_cast<uint32_t>(info.loadAttachmentMask) << 16)
| (static_cast<uint32_t>(info.storeAttachmentMask) << 24));
hb.add_uint32(static_cast<uint32_t>(info.swapchainAttachmentMask)
| (static_cast<uint32_t>(info.subpassCount) << 8)
| (static_cast<uint32_t>(info.createFlags) << 16));
return hb.get();
}
|
whupdup/frame
|
src/graphics/render_pass.cpp
|
C++
|
gpl-3.0
| 18,293
|
#pragma once
#include <core/intrusive_ptr.hpp>
#include <graphics/unique_graphics_object.hpp>
#include <vulkan.h>
namespace ZN::GFX {
class RenderPass final : public Memory::IntrusivePtrEnabled<RenderPass>,
public UniqueGraphicsObject {
public:
using AttachmentCount_T = uint8_t;
using AttachmentBitMask_T = uint8_t;
using AttachmentIndex_T = uint8_t;
using CreateFlags = uint8_t;
static constexpr const uint8_t MAX_COLOR_ATTACHMENTS = 8;
static constexpr const AttachmentIndex_T INVALID_ATTACHMENT_INDEX = ~0;
enum class DepthStencilUsage {
NONE,
READ,
WRITE,
READ_WRITE
};
enum CreateFlagBits : CreateFlags {
CREATE_FLAG_CLEAR_DEPTH_STENCIL = 0b001,
CREATE_FLAG_LOAD_DEPTH_STENCIL = 0b010,
CREATE_FLAG_STORE_DEPTH_STENCIL = 0b100
};
struct AttachmentInfo {
VkFormat format;
VkSampleCountFlagBits samples;
bool operator==(const AttachmentInfo&) const;
bool operator!=(const AttachmentInfo&) const;
};
struct SubpassInfo {
AttachmentIndex_T colorAttachments[MAX_COLOR_ATTACHMENTS];
AttachmentIndex_T inputAttachments[MAX_COLOR_ATTACHMENTS];
AttachmentIndex_T resolveAttachments[MAX_COLOR_ATTACHMENTS];
AttachmentCount_T colorAttachmentCount;
AttachmentCount_T inputAttachmentCount;
AttachmentCount_T resolveAttachmentCount;
DepthStencilUsage depthStencilUsage;
bool operator==(const SubpassInfo&) const;
bool operator!=(const SubpassInfo&) const;
};
struct CreateInfo {
AttachmentInfo colorAttachments[MAX_COLOR_ATTACHMENTS];
AttachmentInfo depthAttachment;
SubpassInfo* pSubpasses;
AttachmentCount_T colorAttachmentCount;
AttachmentBitMask_T clearAttachmentMask;
AttachmentBitMask_T loadAttachmentMask;
AttachmentBitMask_T storeAttachmentMask;
AttachmentBitMask_T swapchainAttachmentMask;
uint8_t subpassCount;
CreateFlags createFlags;
bool operator==(const CreateInfo&) const;
};
static Memory::IntrusivePtr<RenderPass> create(const CreateInfo& createInfo);
NULL_COPY_AND_ASSIGN(RenderPass);
operator VkRenderPass() const;
VkRenderPass get_render_pass() const;
private:
VkRenderPass m_renderPass;
explicit RenderPass(VkRenderPass);
};
}
|
whupdup/frame
|
src/graphics/render_pass.hpp
|
C++
|
gpl-3.0
| 2,202
|
#pragma once
#include <core/common.hpp>
#include <atomic>
namespace ZN::GFX {
class UniqueGraphicsObject {
public:
explicit UniqueGraphicsObject()
: m_uniqueID(s_counter.fetch_add(1, std::memory_order_relaxed)) {}
DEFAULT_COPY_AND_ASSIGN(UniqueGraphicsObject);
constexpr uint64_t get_unique_id() const {
return m_uniqueID;
}
private:
static inline std::atomic_uint64_t s_counter = 1ull;
uint64_t m_uniqueID;
};
}
|
whupdup/frame
|
src/graphics/unique_graphics_object.hpp
|
C++
|
gpl-3.0
| 443
|
#include <gtest/gtest.h>
#include <graphics/barrier_info_collection.hpp>
#include <graphics/command_buffer.hpp>
#include <graphics/image_resource_tracker.hpp>
#include <vulkan.h>
using namespace ZN;
using namespace ZN::GFX;
TEST(IRTester, DepthPyramidStatePreservation) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
for (uint32_t i = 0; i < 10; ++i) {
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = i,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
bic.emit_barriers(cmd);
EXPECT_EQ(res.get_range_count(), 1);
}
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 10,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::ALWAYS, false);
EXPECT_EQ(res.get_range_count(), 1);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 1);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0), 1);
bic.emit_barriers(cmd);
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, FirstBarrierPartialAfterSecond_FullInfo) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = VK_ACCESS_SHADER_READ_BIT,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_GENERAL,
.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
bic.emit_barriers(cmd);
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, FirstBarrierPartialBeforeSecond_FullInfo) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = VK_ACCESS_SHADER_READ_BIT,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_GENERAL,
.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 3,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
bic.emit_barriers(cmd);
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, FirstBarrierFullOverlapSecond_FullInfo) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 4,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 1);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0), 1);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 4,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 1);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 0);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = VK_ACCESS_SHADER_READ_BIT,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_GENERAL,
.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
bic.emit_barriers(cmd);
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, SecondBarrierFullOverlapFirst_FullInfo) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 1);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 4,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
EXPECT_EQ(bic.get_pipeline_barrier_count(), 2);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0), 1);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0), 2);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 3,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, {
.srcAccessMask = VK_ACCESS_SHADER_READ_BIT,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
bic.emit_barriers(cmd);
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, WriteAfterWriteEqualSize) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::ALWAYS, true);
EXPECT_EQ(res.get_range_count(), 1);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::ALWAYS, true);
EXPECT_EQ(res.get_range_count(), 1);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, WriteAfterWriteSecondSmaller) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::ALWAYS, true);
EXPECT_EQ(res.get_range_count(), 1);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::ALWAYS, true);
EXPECT_EQ(res.get_range_count(), 1);
EXPECT_TRUE(res.has_range({
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, WriteAfterWriteSecondSmallerStatesUnequal) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 2,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::ALWAYS, true);
EXPECT_EQ(res.get_range_count(), 1);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::ALWAYS, true);
res.print_ranges();
EXPECT_EQ(res.get_range_count(), 2);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, WriteAfterWriteSecondSmallerQFOT) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
EXPECT_EQ(res.get_range_count(), 1);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 2u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
res.print_ranges();
EXPECT_EQ(res.get_range_count(), 1);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT,
.dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_GENERAL,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = 1u,
.dstQueueFamilyIndex = 2u,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, WriteAfterWriteFirstSmallerQFOT) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
EXPECT_EQ(res.get_range_count(), 1);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_WRITE_BIT,
.queueFamilyIndex = 2u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
res.print_ranges();
EXPECT_EQ(res.get_range_count(), 1);
EXPECT_FALSE(res.has_overlapping_ranges());
}
TEST(IRTester, FirstBarrierPartialBeforeSecondQFOT) {
BarrierInfoCollection bic{};
ImageResourceTracker res{};
CommandBuffer cmd{};
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_GENERAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 1u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
bic.emit_barriers(cmd);
res.update_range(VK_NULL_HANDLE, bic, {
.stageFlags = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
.layout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.accessMask = VK_ACCESS_SHADER_READ_BIT,
.queueFamilyIndex = 2u,
.range = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 1,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}, ImageResourceTracker::BarrierMode::TRANSITIONS_ONLY, false);
res.print_ranges();
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_EQ(bic.get_image_memory_barrier_count(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0), 1);
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = VK_ACCESS_SHADER_READ_BIT,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_GENERAL,
.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.srcQueueFamilyIndex = 1u,
.dstQueueFamilyIndex = 2u,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 3,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
EXPECT_TRUE(bic.contains_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, {
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_READ_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = VK_NULL_HANDLE,
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 3,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}));
bic.print_barriers();
bic.emit_barriers(cmd);
EXPECT_FALSE(res.has_overlapping_ranges());
}
|
whupdup/frame
|
src/ir_tests.cpp
|
C++
|
gpl-3.0
| 23,894
|
#include "vulkan.h"
#include <cstdio>
#include <graphics/barrier_info_collection.hpp>
#include <graphics/command_buffer.hpp>
#include <graphics/frame_graph.hpp>
#include <graphics/image_resource_tracker.hpp>
#include <graphics/render_context.hpp>
#include <graphics/render_pass.hpp>
using namespace ZN;
using namespace ZN::GFX;
static void build_test_graph_1();
static void build_real_frame_graph();
static void render_pass_test() {
RenderPass::SubpassInfo subpasses[] = {
{
.colorAttachments = {0},
.colorAttachmentCount = 1,
},
{
.colorAttachments = {0},
.colorAttachmentCount = 1,
}
};
RenderPass::CreateInfo createInfo{
.colorAttachments = {
{
.format = VK_FORMAT_R8G8B8A8_UNORM,
.samples = VK_SAMPLE_COUNT_1_BIT
}
},
.pSubpasses = subpasses,
.colorAttachmentCount = 1,
.clearAttachmentMask = 0b1,
.storeAttachmentMask = 0b1,
.swapchainAttachmentMask = 0b1,
.subpassCount = 2
};
auto pass = RenderPass::create(createInfo);
auto im = Image::create("I1", 640, 480, VK_FORMAT_R8_UINT);
auto iv = ImageView::create(*im, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
std::vector<Memory::IntrusivePtr<ImageView>> vec;
vec.push_back(iv);
auto r = Framebuffer::create(*pass, vec, 640, 480).get()
== Framebuffer::create(*pass, std::move(vec), 640, 480).get();
puts(r ? "true" : "false");
for (uint32_t i = 0; i < 3; ++i) {
printf("%X\n", RenderPass::create(createInfo)->get_render_pass());
}
}
static void build_two_incompatible_passes() {
CommandBuffer cmd{};
FrameGraph graph{};
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL)
.add_color_attachment(g_renderContext->get_swapchain_image_view(), ResourceAccess::WRITE);
graph.add_pass("P2")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL)
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE);
graph.build(cmd);
cmd.print();
}
int main() {
GFX::g_renderContext.create();
printf("Swapchain image: 0x%X\n",
GFX::g_renderContext->get_swapchain_image_view().get_image().get_image());
render_pass_test();
//build_test_graph_1();
//build_real_frame_graph();
build_two_incompatible_passes();
GFX::g_renderContext.destroy();
}
static void build_test_graph_1() {
FrameGraph graph{};
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_color_attachment(g_renderContext->get_swapchain_image_view(), ResourceAccess::WRITE)
.add_command_callback([](auto& cmd) {
cmd.draw(3, 1, 0, 0);
});
graph.add_pass("C1")
.add_texture(*viewR1, ResourceAccess::READ_WRITE, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL)
.add_command_callback([](auto& cmd) {
cmd.dispatch(2, 2, 1);
});
graph.add_pass("P2")
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE)
.add_command_callback([](auto& cmd) {
cmd.draw(3, 1, 0, 0);
});
CommandBuffer cmd{};
graph.build(cmd);
cmd.print();
}
static void build_real_frame_graph() {
CommandBuffer cmd{};
FrameGraph graph{};
auto depthBuffer = Image::create("depth_buffer", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewDepthBuffer = ImageView::create(*depthBuffer,
{VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
auto depthPyramid = Image::create("depth_pyramid", 1200, 800, VK_FORMAT_R32_SFLOAT,
VK_SAMPLE_COUNT_1_BIT, 5);
auto viewDepthPyramid = ImageView::create(*depthPyramid,
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 5, 0, 1});
Memory::IntrusivePtr<ImageView> viewDepthPyramidMips[5] = {};
for (uint32_t i = 0; i < 5; ++i) {
viewDepthPyramidMips[i] = ImageView::create(*depthPyramid, {VK_IMAGE_ASPECT_COLOR_BIT,
i, 1, 0, 1});
}
auto aoImage = Image::create("ao_image", 1200, 800, VK_FORMAT_R8_UINT);
auto viewAOImage = ImageView::create(*aoImage, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
auto aoTempImage = Image::create("ao_temp_image", 1200, 800, VK_FORMAT_R8_UINT);
auto viewAOTempImage = ImageView::create(*aoTempImage,
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
auto colorBuffer = Image::create("color_buffer", 1200, 800, VK_FORMAT_A2B10G10R10_UNORM_PACK32,
VK_SAMPLE_COUNT_4_BIT);
auto viewColorBuffer = ImageView::create(*colorBuffer,
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
auto depthBufferMS = Image::create("depth_buffer_ms", 1200, 800, VK_FORMAT_D32_SFLOAT,
VK_SAMPLE_COUNT_4_BIT);
auto viewDepthBufferMS = ImageView::create(*depthBufferMS,
{VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
auto colorBufferOIT = Image::create("color_buffer_oit", 1200, 800, VK_FORMAT_R8_UINT);
auto viewColorBufferOIT = ImageView::create(*colorBufferOIT,
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
auto depthBufferOIT = Image::create("depth_buffer_oit", 1200, 800, VK_FORMAT_R8_UINT);
auto viewDepthBufferOIT = ImageView::create(*depthBufferOIT,
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
auto visBufferOIT = Image::create("vis_buffer_oit", 1200, 800, VK_FORMAT_R8_UINT);
auto viewVisBufferOIT = ImageView::create(*visBufferOIT,
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
auto lockBufferOIT = Image::create("lock_buffer_oit", 1200, 800, VK_FORMAT_R8_UINT);
auto viewLockBufferOIT = ImageView::create(*lockBufferOIT,
{VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
auto partMeshPool = Buffer::create("part_mesh_pool", 16384, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
auto indirectCommandBuffer = Buffer::create("indirect_command_buffer", 16384,
VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT);
std::string depthReducePassName = "depth_reduce_0";
for (uint32_t i = 0; i < 5; ++i) {
auto& pass = graph.add_pass(depthReducePassName);
if (i == 0) {
pass.add_texture(*viewDepthBuffer, ResourceAccess::READ,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL);
}
else {
pass.add_texture(*viewDepthPyramidMips[i - 1], ResourceAccess::READ,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL);
}
pass.add_texture(*viewDepthPyramidMips[i], ResourceAccess::WRITE,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL);
pass.add_command_callback([](auto& cmd) {
cmd.dispatch(2, 2, 1);
});
++depthReducePassName.back();
}
graph.add_pass("part_mesh_pool_upload")
.add_buffer(*partMeshPool, ResourceAccess::READ_WRITE, VK_PIPELINE_STAGE_TRANSFER_BIT);
graph.add_pass("copy_zeroed_command_buffer")
.add_buffer(*indirectCommandBuffer, ResourceAccess::READ_WRITE,
VK_PIPELINE_STAGE_TRANSFER_BIT);
graph.add_pass("indirect_cull")
.add_buffer(*indirectCommandBuffer, ResourceAccess::READ_WRITE,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT)
.add_texture(*viewDepthPyramid, ResourceAccess::READ,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
.add_command_callback([](auto& cmd) {
cmd.dispatch(3, 3, 1);
});
graph.add_pass("depth_pre_pass")
.add_buffer(*indirectCommandBuffer, ResourceAccess::READ,
VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT)
.add_depth_stencil_attachment(*viewDepthBuffer, ResourceAccess::WRITE) // FIXME: clear
.add_command_callback([](auto& cmd) {
cmd.draw(3, 1, 0, 0);
});
graph.add_pass("ao_pass")
.add_texture(*viewDepthPyramid, ResourceAccess::READ,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
.add_color_attachment(*viewAOImage, ResourceAccess::WRITE); // FIXME: clear?
graph.add_pass("blur_ao_horizontal")
.add_texture(*viewAOImage, ResourceAccess::READ, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL)
.add_texture(*viewAOTempImage, ResourceAccess::WRITE,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL);
graph.add_pass("blur_ao_vertical")
.add_texture(*viewAOTempImage, ResourceAccess::READ,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL)
.add_texture(*viewAOImage, ResourceAccess::WRITE, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL);
graph.add_pass("opaque_forward")
.add_buffer(*indirectCommandBuffer, ResourceAccess::READ,
VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT)
.add_buffer(*partMeshPool, ResourceAccess::READ, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT)
.add_texture(*viewAOImage, ResourceAccess::READ, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL)
.add_depth_stencil_attachment(*viewDepthBufferMS, ResourceAccess::READ_WRITE)
.add_color_attachment(*viewColorBuffer, ResourceAccess::WRITE);
graph.add_pass("transparent_forward")
.add_buffer(*indirectCommandBuffer, ResourceAccess::READ,
VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT)
.add_buffer(*partMeshPool, ResourceAccess::READ, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT)
.add_texture(*viewColorBufferOIT, ResourceAccess::READ_WRITE,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL)
.add_texture(*viewDepthBufferOIT, ResourceAccess::READ_WRITE,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL)
.add_texture(*viewVisBufferOIT, ResourceAccess::READ_WRITE,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL)
.add_texture(*viewLockBufferOIT, ResourceAccess::READ_WRITE,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL)
.add_depth_stencil_attachment(*viewDepthBuffer, ResourceAccess::READ);
graph.add_pass("tone_mapping")
.add_texture(*viewColorBufferOIT, ResourceAccess::READ,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL)
.add_texture(*viewVisBufferOIT, ResourceAccess::READ,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_IMAGE_LAYOUT_GENERAL)
.add_input_attachment(*viewColorBuffer)
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE);
graph.add_pass("ui")
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE);
graph.build(cmd);
cmd.print();
}
|
whupdup/frame
|
src/main.cpp
|
C++
|
gpl-3.0
| 10,290
|
#include <gtest/gtest.h>
#include <graphics/render_context.hpp>
int main(int argc, char** argv) {
ZN::GFX::g_renderContext.create();
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
|
whupdup/frame
|
src/rg_tester.cpp
|
C++
|
gpl-3.0
| 204
|
#include <gtest/gtest.h>
#include <graphics/command_buffer.hpp>
#include <graphics/frame_graph.hpp>
#include <graphics/render_context.hpp>
using namespace ZN;
using namespace ZN::GFX;
static void check_commands(const CommandBuffer& a, const CommandBuffer& b) {
ASSERT_EQ(a.get_commands().size(), b.get_commands().size());
for (size_t i = 0; i < a.get_commands().size(); ++i) {
auto& cA = *a.get_commands()[i];
auto& cB = *b.get_commands()[i];
//printf("command %llu\n", i);
EXPECT_TRUE(cA == cB);
}
}
TEST(RG_RenderPassBuilding, SinglePass) {
CommandBuffer cmd{};
FrameGraph graph{};
graph.add_pass("P1")
.add_color_attachment(g_renderContext->get_swapchain_image_view(), ResourceAccess::WRITE);
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 1);
ASSERT_EQ(graph.get_render_pass_intervals()[0].get_create_info().subpassCount, 1);
ASSERT_EQ(graph.get_render_pass_intervals()[0].get_create_info().colorAttachmentCount, 1);
VkRenderPassBeginInfo beginInfos[] = {
{
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
.renderPass = *graph.get_render_passes()[0].renderPass,
.framebuffer = *graph.get_render_passes()[0].framebuffer,
.renderArea = {
.offset = {},
.extent = {1200, 800}
},
.clearValueCount = 0,
}
};
CommandBuffer tcmd{};
tcmd.begin_render_pass(beginInfos);
tcmd.end_render_pass();
//EXPECT_EQ(rpInfo[0].clearAttachmentMask, 0);
//EXPECT_EQ(rpInfo[0].loadAttachmentMask, 0);
//EXPECT_EQ(rpInfo[0].storeAttachmentMask, 1);
check_commands(cmd, tcmd);
}
TEST(RG_RenderPassBuilding, TwoCompatiblePasses) {
CommandBuffer cmd{};
FrameGraph graph{};
graph.add_pass("P1")
.add_color_attachment(g_renderContext->get_swapchain_image_view(), ResourceAccess::WRITE);
graph.add_pass("P2")
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE);
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 2);
ASSERT_EQ(graph.get_render_pass_intervals()[0].get_create_info().subpassCount, 2);
ASSERT_EQ(graph.get_render_pass_intervals()[0].get_create_info().colorAttachmentCount, 1);
}
TEST(RG_RenderPassBuilding, TwoIncompatiblePasses) {
CommandBuffer cmd{};
FrameGraph graph{};
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL)
.add_color_attachment(g_renderContext->get_swapchain_image_view(), ResourceAccess::WRITE);
graph.add_pass("P2")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL)
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE);
graph.build(cmd);
VkImageMemoryBarrier barriers[] = {
{
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = g_renderContext->get_swapchain_image().get_image(),
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
},
{
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
.newLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = g_renderContext->get_swapchain_image().get_image(),
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
},
{
.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT,
.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED,
.newLayout = VK_IMAGE_LAYOUT_GENERAL,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = r1->get_image(),
.subresourceRange = {
.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = 1
}
}
};
VkRenderPassBeginInfo beginInfos[] = {
{
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
.renderPass = *graph.get_render_passes()[0].renderPass,
.framebuffer = *graph.get_render_passes()[0].framebuffer,
.renderArea = {
.offset = {},
.extent = {1200, 800}
},
.clearValueCount = 0,
},
{
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
.renderPass = *graph.get_render_passes()[1].renderPass,
.framebuffer = *graph.get_render_passes()[1].framebuffer,
.renderArea = {
.offset = {},
.extent = {1200, 800}
},
.clearValueCount = 0,
}
};
CommandBuffer tcmd{};
tcmd.pipeline_barrier(VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, 0, nullptr, 0, nullptr, 1, &barriers[2]);
tcmd.begin_render_pass(&beginInfos[0]);
tcmd.end_render_pass();
tcmd.pipeline_barrier(VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, 0, nullptr, 0, nullptr, 1, &barriers[2]);
tcmd.pipeline_barrier(VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, 0, 0, nullptr, 0, nullptr, 1,
&barriers[1]);
tcmd.begin_render_pass(&beginInfos[1]);
tcmd.end_render_pass();
ASSERT_EQ(graph.get_render_pass_intervals().size(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_start_index(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_end_index(), 2);
ASSERT_EQ(graph.get_render_pass_intervals()[0].get_create_info().subpassCount, 1);
ASSERT_EQ(graph.get_render_pass_intervals()[0].get_create_info().colorAttachmentCount, 1);
ASSERT_EQ(graph.get_render_pass_intervals()[1].get_create_info().subpassCount, 1);
ASSERT_EQ(graph.get_render_pass_intervals()[1].get_create_info().colorAttachmentCount, 1);
check_commands(cmd, tcmd);
}
TEST(RG_RenderPassBuilding, TwoCompatibleOneIrrelevantAdjacent) {
CommandBuffer cmd{};
FrameGraph graph{};
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_color_attachment(g_renderContext->get_swapchain_image_view(), ResourceAccess::WRITE);
graph.add_pass("P2")
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE);
graph.add_pass("C1")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL);
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 2);
}
TEST(RG_RenderPassBuilding, TwoCompatibleOneIrrelevantSwap) {
CommandBuffer cmd{};
FrameGraph graph{};
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_color_attachment(g_renderContext->get_swapchain_image_view(), ResourceAccess::WRITE);
graph.add_pass("C1")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL);
graph.add_pass("P2")
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE);
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 2);
}
TEST(RG_RenderPassBuilding, TwoIncompatibleOneIrrelevantSwap) {
CommandBuffer cmd{};
FrameGraph graph{};
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_color_attachment(g_renderContext->get_swapchain_image_view(), ResourceAccess::WRITE);
graph.add_pass("C1")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL);
graph.add_pass("P2")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL)
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE);
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_start_index(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_end_index(), 3);
}
TEST(RG_RenderPassBuilding, ClearPassNoSwapMerge) {
CommandBuffer cmd{};
FrameGraph graph{};
graph.add_pass("P1")
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.add_pass("P2")
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE);
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 2);
}
TEST(RG_RenderPassBuilding, ClearPassSwapMerge) {
CommandBuffer cmd{};
FrameGraph graph{};
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.add_pass("C1")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL);
graph.add_pass("P2")
.add_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::READ_WRITE);
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 2);
}
TEST(RG_RenderPassBuilding, ClearPassNoSwapNoMerge) {
CommandBuffer cmd{};
FrameGraph graph{};
graph.add_pass("P1")
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.add_pass("P2")
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_start_index(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_end_index(), 2);
}
TEST(RG_RenderPassBuilding, ClearPassSwapNoMerge) {
CommandBuffer cmd{};
FrameGraph graph{};
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.add_pass("C1")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL);
graph.add_pass("P2")
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_start_index(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_end_index(), 3);
}
TEST(RG_RenderPassBuilding, DepthBufferNoSwapMerge) {
CommandBuffer cmd{};
FrameGraph graph{};
auto d1 = Image::create("D1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewD1 = ImageView::create(*d1, {VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_cleared_depth_stencil_attachment(*viewD1, ResourceAccess::READ_WRITE, {});
graph.add_pass("P2")
.add_depth_stencil_attachment(*viewD1, ResourceAccess::READ_WRITE)
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 2);
}
TEST(RG_RenderPassBuilding, DepthBufferSwapMerge) {
CommandBuffer cmd{};
FrameGraph graph{};
auto d1 = Image::create("D1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewD1 = ImageView::create(*d1, {VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_cleared_depth_stencil_attachment(*viewD1, ResourceAccess::READ_WRITE, {});
graph.add_pass("C1")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL);
graph.add_pass("P2")
.add_depth_stencil_attachment(*viewD1, ResourceAccess::READ_WRITE)
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 2);
}
TEST(RG_RenderPassBuilding, IncompatibleDepthBufferNoSwapNoMerge) {
CommandBuffer cmd{};
FrameGraph graph{};
auto d1 = Image::create("D1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewD1 = ImageView::create(*d1, {VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
auto d2 = Image::create("D2", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewD2 = ImageView::create(*d2, {VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_cleared_depth_stencil_attachment(*viewD1, ResourceAccess::READ_WRITE, {});
graph.add_pass("P2")
.add_depth_stencil_attachment(*viewD2, ResourceAccess::READ_WRITE)
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_start_index(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_end_index(), 2);
}
TEST(RG_RenderPassBuilding, IncompatibleDepthBufferSwapNoMerge) {
CommandBuffer cmd{};
FrameGraph graph{};
auto d1 = Image::create("D1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewD1 = ImageView::create(*d1, {VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
auto d2 = Image::create("D2", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewD2 = ImageView::create(*d2, {VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_cleared_depth_stencil_attachment(*viewD1, ResourceAccess::READ_WRITE, {});
graph.add_pass("C1")
.add_texture(*viewR1, ResourceAccess::WRITE, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
VK_IMAGE_LAYOUT_GENERAL);
graph.add_pass("P2")
.add_depth_stencil_attachment(*viewD2, ResourceAccess::READ_WRITE)
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 1);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_start_index(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_end_index(), 3);
}
TEST(RG_RenderPassBuilding, IncompatibleDepthBufferNoMerge3Passes) {
CommandBuffer cmd{};
FrameGraph graph{};
auto d1 = Image::create("D1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewD1 = ImageView::create(*d1, {VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
auto d2 = Image::create("D2", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewD2 = ImageView::create(*d2, {VK_IMAGE_ASPECT_DEPTH_BIT, 0, 1, 0, 1});
auto r1 = Image::create("R1", 1200, 800, VK_FORMAT_D32_SFLOAT);
auto viewR1 = ImageView::create(*r1, {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1});
graph.add_pass("P1")
.add_cleared_depth_stencil_attachment(*viewD1, ResourceAccess::READ_WRITE, {});
graph.add_pass("P2")
.add_color_attachment(*viewR1, ResourceAccess::WRITE);
graph.add_pass("P3")
.add_depth_stencil_attachment(*viewD2, ResourceAccess::READ_WRITE)
.add_cleared_color_attachment(g_renderContext->get_swapchain_image_view(),
ResourceAccess::WRITE, {});
graph.build(cmd);
ASSERT_EQ(graph.get_render_pass_intervals().size(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_start_index(), 0);
EXPECT_EQ(graph.get_render_pass_intervals()[0].get_end_index(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_start_index(), 2);
EXPECT_EQ(graph.get_render_pass_intervals()[1].get_end_index(), 3);
}
|
whupdup/frame
|
src/rg_tests.cpp
|
C++
|
gpl-3.0
| 18,474
|
#include "vulkan.h"
#include <cstdio>
#include <atomic>
static std::atomic_uint64_t g_bufferCounter = 1ull;
static std::atomic_uint64_t g_framebufferCounter = 1ull;
static std::atomic_uint64_t g_imageCounter = 1ull;
static std::atomic_uint64_t g_renderPassCounter = 1ull;
static void print_render_pass(const VkRenderPassCreateInfo* pCreateInfo,
VkRenderPass* pRenderPass);
static void print_attachment_list(const VkAttachmentReference* pList, uint32_t count);
VkResult vkCreateBuffer(VkDevice, const VkBufferCreateInfo*, const VkAllocationCallbacks*,
VkBuffer* pBuffer) {
*pBuffer = g_bufferCounter.fetch_add(1, std::memory_order_relaxed);
return VK_SUCCESS;
}
VkResult vkCreateFramebuffer(VkDevice, const VkFramebufferCreateInfo*,
const VkAllocationCallbacks*, VkFramebuffer* pFramebuffer) {
*pFramebuffer = g_framebufferCounter.fetch_add(1, std::memory_order_relaxed);
return VK_SUCCESS;
}
VkResult vkCreateImage(VkDevice, const VkImageCreateInfo*, const VkAllocationCallbacks*,
VkImage *pImage) {
*pImage = g_imageCounter.fetch_add(1, std::memory_order_relaxed);
return VK_SUCCESS;
}
VkResult vkCreateRenderPass(VkDevice, const VkRenderPassCreateInfo* pCreateInfo,
const VkAllocationCallbacks*, VkRenderPass* pRenderPass) {
*pRenderPass = g_renderPassCounter.fetch_add(1, std::memory_order_relaxed);
//print_render_pass(pCreateInfo, pRenderPass);
return VK_SUCCESS;
}
static void print_render_pass(const VkRenderPassCreateInfo* pCreateInfo,
VkRenderPass* pRenderPass) {
printf("VkRenderPass %llu\n", *pRenderPass);
puts(".attachments:");
for (uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i) {
auto& desc = pCreateInfo->pAttachments[i];
puts("\t{");
printf("\t\t.format = %u\n", desc.format);
printf("\t\t.samples = %u\n", desc.samples);
printf("\t\t.loadOp = %u\n", desc.loadOp);
printf("\t\t.storeOp = %u\n", desc.storeOp);
printf("\t\t.stencilLoadOp = %u\n", desc.stencilLoadOp);
printf("\t\t.stencilStoreOp = %u\n", desc.stencilStoreOp);
printf("\t\t.initialLayout = %u\n", desc.initialLayout);
printf("\t\t.finalLayout = %u\n", desc.finalLayout);
puts("\t}");
}
puts(".subpasses:");
for (uint32_t i = 0; i < pCreateInfo->subpassCount; ++i) {
auto& sp = pCreateInfo->pSubpasses[i];
puts("\t{");
printf("\t\t.inputAttachments: {");
print_attachment_list(sp.pInputAttachments, sp.inputAttachmentCount);
printf("\t\t.colorAttachments: {");
print_attachment_list(sp.pColorAttachments, sp.colorAttachmentCount);
printf("\t\t.resolveAttachments: {");
print_attachment_list(sp.pResolveAttachments, sp.colorAttachmentCount);
printf("\t\t.preserveAttachments: {");
for (uint32_t j = 0; j < sp.preserveAttachmentCount; ++j) {
printf("%u", sp.pPreserveAttachments[j]);
if (j != sp.preserveAttachmentCount - 1) {
printf(", ");
}
}
puts("}");
puts("\t}");
}
puts(".dependencies:");
for (uint32_t i = 0; i < pCreateInfo->dependencyCount; ++i) {
auto& sd = pCreateInfo->pDependencies[i];
puts("\t{");
printf("\t\t.srcSubpass = %u\n", sd.srcSubpass);
printf("\t\t.dstSubpass = %u\n", sd.dstSubpass);
printf("\t\t.srcStageMask = 0x%X\n", sd.srcStageMask);
printf("\t\t.dstStageMask = 0x%X\n", sd.srcStageMask);
printf("\t\t.srcAccessMask = 0x%X\n", sd.srcAccessMask);
printf("\t\t.dstAccessMask = 0x%X\n", sd.dstAccessMask);
printf("\t\t.dependencyFlags = 0x%X\n", sd.dependencyFlags);
puts("\t}");
}
}
static void print_attachment_list(const VkAttachmentReference* pList, uint32_t count) {
if (pList) {
for (uint32_t j = 0; j < count; ++j) {
printf("{%u, %u}", pList[j].attachment, pList[j].layout);
if (j != count - 1) {
printf(", ");
}
}
}
puts("}");
}
|
whupdup/frame
|
src/vulkan.cpp
|
C++
|
gpl-3.0
| 3,710
|
#pragma once
#include <cstddef>
#include <cstdint>
#define VK_NULL_HANDLE (0)
#define VK_QUEUE_FAMILY_IGNORED (~0U)
#define VK_SUBPASS_EXTERNAL (~0U)
#define VK_ATTACHMENT_UNUSED (~0U)
#define VK_WHOLE_SIZE (~0ULL)
#define VK_REMAINING_MIP_LEVELS (~0U)
#define VK_REMAINING_ARRAY_LAYERS (~0U)
using VkFlags = uint32_t;
using VkAccessFlags = VkFlags;
using VkPipelineStageFlags = VkFlags;
using VkImageAspectFlags = VkFlags;
using VkSampleCountFlags = VkFlags;
using VkDependencyFlags = VkFlags;
using VkBufferUsageFlags = VkFlags;
struct VkSemaphore_T;
using VkBuffer = uint64_t;
using VkDevice = void*;
using VkFramebuffer = uint64_t;
using VkImage = uint64_t;
using VkImageView = uint64_t;
using VkRenderPass = uint64_t;
using VkSemaphore = VkSemaphore_T*;
using VkDeviceSize = size_t;
enum VkResult {
VK_SUCCESS = 0,
VK_NOT_READY = 1,
VK_TIMEOUT = 2,
VK_EVENT_SET = 3,
VK_EVENT_RESET = 4,
VK_INCOMPLETE = 5,
VK_ERROR_OUT_OF_HOST_MEMORY = -1,
VK_ERROR_OUT_OF_DEVICE_MEMORY = -2,
VK_ERROR_INITIALIZATION_FAILED = -3,
VK_ERROR_DEVICE_LOST = -4,
VK_ERROR_MEMORY_MAP_FAILED = -5,
VK_ERROR_LAYER_NOT_PRESENT = -6,
VK_ERROR_EXTENSION_NOT_PRESENT = -7,
VK_ERROR_FEATURE_NOT_PRESENT = -8,
VK_ERROR_INCOMPATIBLE_DRIVER = -9,
VK_ERROR_TOO_MANY_OBJECTS = -10,
VK_ERROR_FORMAT_NOT_SUPPORTED = -11,
VK_ERROR_FRAGMENTED_POOL = -12,
VK_ERROR_UNKNOWN = -13,
};
enum VkStructureType {
VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46
};
enum VkAccessFlagBits : VkAccessFlags {
VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
VK_ACCESS_INDEX_READ_BIT = 0x00000002,
VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
VK_ACCESS_SHADER_READ_BIT = 0x00000020,
VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
VK_ACCESS_HOST_READ_BIT = 0x00002000,
VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000
};
enum VkPipelineStageFlagBits : VkPipelineStageFlags {
VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001,
VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002,
VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004,
VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008,
VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010,
VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020,
VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040,
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080,
VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100,
VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200,
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400,
VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800,
VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000,
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
VK_PIPELINE_STAGE_HOST_BIT = 0x00004000,
VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000
};
enum VkImageLayout {
VK_IMAGE_LAYOUT_UNDEFINED = 0,
VK_IMAGE_LAYOUT_GENERAL = 1,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3,
VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4,
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5,
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 6,
VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 7,
VK_IMAGE_LAYOUT_PREINITIALIZED = 8,
// Provided by VK_KHR_swapchain
VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002
};
enum VkImageAspectFlagBits : VkImageAspectFlags {
VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008
};
enum VkFormat {
VK_FORMAT_UNDEFINED = 0,
VK_FORMAT_R4G4_UNORM_PACK8 = 1,
VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
VK_FORMAT_R8_UNORM = 9,
VK_FORMAT_R8_SNORM = 10,
VK_FORMAT_R8_USCALED = 11,
VK_FORMAT_R8_SSCALED = 12,
VK_FORMAT_R8_UINT = 13,
VK_FORMAT_R8_SINT = 14,
VK_FORMAT_R8_SRGB = 15,
VK_FORMAT_R8G8_UNORM = 16,
VK_FORMAT_R8G8_SNORM = 17,
VK_FORMAT_R8G8_USCALED = 18,
VK_FORMAT_R8G8_SSCALED = 19,
VK_FORMAT_R8G8_UINT = 20,
VK_FORMAT_R8G8_SINT = 21,
VK_FORMAT_R8G8_SRGB = 22,
VK_FORMAT_R8G8B8_UNORM = 23,
VK_FORMAT_R8G8B8_SNORM = 24,
VK_FORMAT_R8G8B8_USCALED = 25,
VK_FORMAT_R8G8B8_SSCALED = 26,
VK_FORMAT_R8G8B8_UINT = 27,
VK_FORMAT_R8G8B8_SINT = 28,
VK_FORMAT_R8G8B8_SRGB = 29,
VK_FORMAT_B8G8R8_UNORM = 30,
VK_FORMAT_B8G8R8_SNORM = 31,
VK_FORMAT_B8G8R8_USCALED = 32,
VK_FORMAT_B8G8R8_SSCALED = 33,
VK_FORMAT_B8G8R8_UINT = 34,
VK_FORMAT_B8G8R8_SINT = 35,
VK_FORMAT_B8G8R8_SRGB = 36,
VK_FORMAT_R8G8B8A8_UNORM = 37,
VK_FORMAT_R8G8B8A8_SNORM = 38,
VK_FORMAT_R8G8B8A8_USCALED = 39,
VK_FORMAT_R8G8B8A8_SSCALED = 40,
VK_FORMAT_R8G8B8A8_UINT = 41,
VK_FORMAT_R8G8B8A8_SINT = 42,
VK_FORMAT_R8G8B8A8_SRGB = 43,
VK_FORMAT_B8G8R8A8_UNORM = 44,
VK_FORMAT_B8G8R8A8_SNORM = 45,
VK_FORMAT_B8G8R8A8_USCALED = 46,
VK_FORMAT_B8G8R8A8_SSCALED = 47,
VK_FORMAT_B8G8R8A8_UINT = 48,
VK_FORMAT_B8G8R8A8_SINT = 49,
VK_FORMAT_B8G8R8A8_SRGB = 50,
VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
VK_FORMAT_R16_UNORM = 70,
VK_FORMAT_R16_SNORM = 71,
VK_FORMAT_R16_USCALED = 72,
VK_FORMAT_R16_SSCALED = 73,
VK_FORMAT_R16_UINT = 74,
VK_FORMAT_R16_SINT = 75,
VK_FORMAT_R16_SFLOAT = 76,
VK_FORMAT_R16G16_UNORM = 77,
VK_FORMAT_R16G16_SNORM = 78,
VK_FORMAT_R16G16_USCALED = 79,
VK_FORMAT_R16G16_SSCALED = 80,
VK_FORMAT_R16G16_UINT = 81,
VK_FORMAT_R16G16_SINT = 82,
VK_FORMAT_R16G16_SFLOAT = 83,
VK_FORMAT_R16G16B16_UNORM = 84,
VK_FORMAT_R16G16B16_SNORM = 85,
VK_FORMAT_R16G16B16_USCALED = 86,
VK_FORMAT_R16G16B16_SSCALED = 87,
VK_FORMAT_R16G16B16_UINT = 88,
VK_FORMAT_R16G16B16_SINT = 89,
VK_FORMAT_R16G16B16_SFLOAT = 90,
VK_FORMAT_R16G16B16A16_UNORM = 91,
VK_FORMAT_R16G16B16A16_SNORM = 92,
VK_FORMAT_R16G16B16A16_USCALED = 93,
VK_FORMAT_R16G16B16A16_SSCALED = 94,
VK_FORMAT_R16G16B16A16_UINT = 95,
VK_FORMAT_R16G16B16A16_SINT = 96,
VK_FORMAT_R16G16B16A16_SFLOAT = 97,
VK_FORMAT_R32_UINT = 98,
VK_FORMAT_R32_SINT = 99,
VK_FORMAT_R32_SFLOAT = 100,
VK_FORMAT_R32G32_UINT = 101,
VK_FORMAT_R32G32_SINT = 102,
VK_FORMAT_R32G32_SFLOAT = 103,
VK_FORMAT_R32G32B32_UINT = 104,
VK_FORMAT_R32G32B32_SINT = 105,
VK_FORMAT_R32G32B32_SFLOAT = 106,
VK_FORMAT_R32G32B32A32_UINT = 107,
VK_FORMAT_R32G32B32A32_SINT = 108,
VK_FORMAT_R32G32B32A32_SFLOAT = 109,
VK_FORMAT_R64_UINT = 110,
VK_FORMAT_R64_SINT = 111,
VK_FORMAT_R64_SFLOAT = 112,
VK_FORMAT_R64G64_UINT = 113,
VK_FORMAT_R64G64_SINT = 114,
VK_FORMAT_R64G64_SFLOAT = 115,
VK_FORMAT_R64G64B64_UINT = 116,
VK_FORMAT_R64G64B64_SINT = 117,
VK_FORMAT_R64G64B64_SFLOAT = 118,
VK_FORMAT_R64G64B64A64_UINT = 119,
VK_FORMAT_R64G64B64A64_SINT = 120,
VK_FORMAT_R64G64B64A64_SFLOAT = 121,
VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
VK_FORMAT_D16_UNORM = 124,
VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
VK_FORMAT_D32_SFLOAT = 126,
VK_FORMAT_S8_UINT = 127,
VK_FORMAT_D16_UNORM_S8_UINT = 128,
VK_FORMAT_D24_UNORM_S8_UINT = 129,
VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
VK_FORMAT_BC2_UNORM_BLOCK = 135,
VK_FORMAT_BC2_SRGB_BLOCK = 136,
VK_FORMAT_BC3_UNORM_BLOCK = 137,
VK_FORMAT_BC3_SRGB_BLOCK = 138,
VK_FORMAT_BC4_UNORM_BLOCK = 139,
VK_FORMAT_BC4_SNORM_BLOCK = 140,
VK_FORMAT_BC5_UNORM_BLOCK = 141,
VK_FORMAT_BC5_SNORM_BLOCK = 142,
VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
VK_FORMAT_BC7_UNORM_BLOCK = 145,
VK_FORMAT_BC7_SRGB_BLOCK = 146,
VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184
};
enum VkSampleCountFlagBits : VkSampleCountFlags {
VK_SAMPLE_COUNT_1_BIT = 0x00000001,
VK_SAMPLE_COUNT_2_BIT = 0x00000002,
VK_SAMPLE_COUNT_4_BIT = 0x00000004,
VK_SAMPLE_COUNT_8_BIT = 0x00000008,
VK_SAMPLE_COUNT_16_BIT = 0x00000010,
VK_SAMPLE_COUNT_32_BIT = 0x00000020,
VK_SAMPLE_COUNT_64_BIT = 0x00000040
};
enum VkDependencyFlagBits : VkDependencyFlags {
VK_DEPENDENCY_BY_REGION_BIT = 0x00000001
};
enum VkSubpassContents {
VK_SUBPASS_CONTENTS_INLINE = 0,
VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 1
};
enum VkImageType {
VK_IMAGE_TYPE_1D = 0,
VK_IMAGE_TYPE_2D = 1,
VK_IMAGE_TYPE_3D = 2,
};
enum VkBufferUsageFlagBits : VkBufferUsageFlags {
VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001,
VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002,
VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004,
VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008,
VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010,
VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020,
VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040,
VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080,
VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100,
};
struct VkImageSubresourceRange {
VkImageAspectFlags aspectMask;
uint32_t baseMipLevel;
uint32_t levelCount;
uint32_t baseArrayLayer;
uint32_t layerCount;
};
struct VkImageSubresource {
VkImageAspectFlags aspectMask;
uint32_t mipLevel;
uint32_t arrayLayer;
};
struct VkImageMemoryBarrier {
VkStructureType sType;
const void* pNext;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
VkImageLayout oldLayout;
VkImageLayout newLayout;
uint32_t srcQueueFamilyIndex;
uint32_t dstQueueFamilyIndex;
VkImage image;
VkImageSubresourceRange subresourceRange;
};
struct VkBufferMemoryBarrier {
VkStructureType sType;
const void* pNext;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
uint32_t srcQueueFamilyIndex;
uint32_t dstQueueFamilyIndex;
VkBuffer buffer;
VkDeviceSize offset;
VkDeviceSize size;
};
struct VkMemoryBarrier {
VkStructureType sType;
const void* pNext;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
};
struct VkOffset2D {
int32_t x;
int32_t y;
};
struct VkExtent2D {
uint32_t width;
uint32_t height;
};
struct VkExtent3D {
uint32_t width;
uint32_t height;
uint32_t depth;
};
struct VkRect2D {
VkOffset2D offset;
VkExtent2D extent;
};
struct VkImageCreateInfo {
VkStructureType sType;
const void* pNext;
VkFlags flags;
VkImageType imageType;
VkFormat format;
VkExtent3D extent;
uint32_t mipLevels;
uint32_t arrayLayers;
VkSampleCountFlagBits samples;
};
struct VkBufferCreateInfo {
VkStructureType sType;
const void* pNext;
VkFlags flags;
VkDeviceSize size;
VkBufferUsageFlags usage;
VkFlags sharingMode;
uint32_t queueFamilyIndexCount;
const uint32_t* pQueueFamilyIndices;
};
enum VkAttachmentLoadOp {
VK_ATTACHMENT_LOAD_OP_LOAD = 0,
VK_ATTACHMENT_LOAD_OP_CLEAR = 1,
VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2
};
enum VkAttachmentStoreOp {
VK_ATTACHMENT_STORE_OP_STORE = 0,
VK_ATTACHMENT_STORE_OP_DONT_CARE = 1
};
struct VkAttachmentReference {
uint32_t attachment;
VkImageLayout layout;
};
struct VkAttachmentDescription {
VkFlags flags;
VkFormat format;
VkSampleCountFlagBits samples;
VkAttachmentLoadOp loadOp;
VkAttachmentStoreOp storeOp;
VkAttachmentLoadOp stencilLoadOp;
VkAttachmentStoreOp stencilStoreOp;
VkImageLayout initialLayout;
VkImageLayout finalLayout;
};
struct VkSubpassDescription {
VkFlags flags;
uint32_t inputAttachmentCount;
const VkAttachmentReference* pInputAttachments;
uint32_t colorAttachmentCount;
const VkAttachmentReference* pColorAttachments;
const VkAttachmentReference* pResolveAttachments;
const VkAttachmentReference* pDepthStencilAttachment;
uint32_t preserveAttachmentCount;
const uint32_t* pPreserveAttachments;
};
struct VkSubpassDependency {
uint32_t srcSubpass;
uint32_t dstSubpass;
VkPipelineStageFlags srcStageMask;
VkPipelineStageFlags dstStageMask;
VkAccessFlags srcAccessMask;
VkAccessFlags dstAccessMask;
VkDependencyFlags dependencyFlags;
};
struct VkRenderPassCreateInfo {
VkStructureType sType;
const void* pNext;
VkFlags flags;
uint32_t attachmentCount;
const VkAttachmentDescription* pAttachments;
uint32_t subpassCount;
const VkSubpassDescription* pSubpasses;
uint32_t dependencyCount;
const VkSubpassDependency* pDependencies;
};
struct VkFramebufferCreateInfo {
VkStructureType sType;
const void* pNext;
VkFlags flags;
VkRenderPass renderPass;
uint32_t attachmentCount;
const VkImageView* pAttachments;
uint32_t width;
uint32_t height;
uint32_t layers;
};
union VkClearColorValue {
float float32[4];
int32_t int32[4];
uint32_t uint32[4];
};
union VkClearDepthStencilValue {
float depth;
uint32_t stencil;
};
union VkClearValue {
VkClearColorValue color;
VkClearDepthStencilValue depthStencil;
};
struct VkRenderPassBeginInfo {
VkStructureType sType;
const void* pNext;
VkRenderPass renderPass;
VkFramebuffer framebuffer;
VkRect2D renderArea;
uint32_t clearValueCount;
const VkClearValue* pClearValues;
};
struct VkAllocationCallbacks;
VkResult vkCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer);
VkResult vkCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer);
VkResult vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkImage* pImage);
VkResult vkCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass);
|
whupdup/frame
|
src/vulkan.h
|
C++
|
gpl-3.0
| 17,306
|
#pragma once
#include <vulkan.h>
|
whupdup/frame
|
src/vulkan_utils.hpp
|
C++
|
gpl-3.0
| 35
|
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
target/
# IPython Notebook
.ipynb_checkpoints
# pyenv
.python-version
# celery beat schedule file
celerybeat-schedule
# dotenv
.env
# virtualenv
venv/
ENV/
# Spyder project settings
.spyderproject
# Rope project settings
.ropeproject
# Start.tw
src/config/start.tw
|
r3d/fc
|
.gitignore
|
Git
|
bsd-3-clause
| 1,078
|
# Ignore everything in this directory
*
# Except this file
!.gitignore
|
r3d/fc
|
bin/.gitignore
|
Git
|
bsd-3-clause
| 75
|
#!/bin/bash
# Will add all *.tw files to StoryIncludes.
rm src/config/start.tw
cp src/config/start.tw.proto start.tw.tmp
find src -name '*.tw' -print >>start.tw.tmp
mv start.tw.tmp src/config/start.tw
HASH=`git log -n1 |grep commit | sed 's/commit //'`
./devTools/tweeGo/tweego -o bin/FC_pregmod.html src/config/start.tw
rm src/config/start.tw
|
r3d/fc
|
compile
|
none
|
bsd-3-clause
| 347
|
#!/bin/bash
# Will add all *.tw files to StoryIncludes.
rm src/config/start.tw
cp src/config/start.tw.proto start.tw.tmp
find src -name '*.tw' -print >>start.tw.tmp
mv start.tw.tmp src/config/start.tw
HASH=`git log -n1 |grep -m1 commit | sed 's/commit //'`
./devTools/tweeGo/tweego -o bin/FC_pregmod_$HASH.html src/config/start.tw
rm src/config/start.tw
echo "FC_pregmod_$HASH.html" compilation finished.
|
r3d/fc
|
compile-git
|
none
|
bsd-3-clause
| 409
|
@echo off
:: Free Cities Basic Compiler - Windows x86_64
:: Will add all *.tw files to StoryIncludes.
del src\config\start.tw
copy src\config\start.tw.proto start.tw.tmp >nul
>>start.tw.tmp (for /r "src" %%F in (*.tw) do echo %%F)
move start.tw.tmp src\config\start.tw >nul
CALL "%~dp0devTools\tweeGo\tweego.exe" -o "%~dp0bin/FC_pregmod.html" "%~dp0src\config\start.tw"
del src\config\start.tw
ECHO Done
|
r3d/fc
|
compile.bat
|
Batchfile
|
bsd-3-clause
| 420
|
@echo off
:: Free Cities Basic Compiler - Windows x86_64
:: Will wait for keypress before terminating.
:: Will add all *.tw files to StoryIncludes.
del src\config\start.tw
copy src\config\start.tw.proto start.tw.tmp >nul
>>start.tw.tmp (for /r "src" %%F in (*.tw) do echo %%F)
move start.tw.tmp src\config\start.tw >nul
CALL "%~dp0devTools\tweeGo\tweego.exe" -o "%~dp0bin/FC_pregmod.html" "%~dp0src\config\start.tw"
del src\config\start.tw
ECHO Done
PAUSE
|
r3d/fc
|
compile_debug.bat
|
Batchfile
|
bsd-3-clause
| 459
|
:: slave generation widgets [nobr]
<<widget "NationalityToRace">>
<<if $fixedRace == 0>>
<<if ($activeSlave.nationality is "American")>>
<<set $activeSlave.race to either("black", "middle eastern", "white", "white", "white", "latina", "latina", "asian", "amerindian", "mixed race")>>
<<elseif ($activeSlave.nationality is "Canadian")>>
<<set $activeSlave.race to either("white", "white", "white", "white", "amerindian")>>
<<elseif ($activeSlave.nationality is "Puerto Rican")>>
<<set $activeSlave.race to either("latina")>>
<<elseif ($activeSlave.nationality is "Cuban")>>
<<set $activeSlave.race to either("latina", "black")>>
<<elseif ($activeSlave.nationality is "Haitian")>>
<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Jamaican")>>
<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Mexican")>>
<<set $activeSlave.race to either("latina", "latina", "latina", "latina", "latina", "amerindian")>>
<<elseif ($activeSlave.nationality is "Dominican")>>
<<set $activeSlave.race to either("mixed race", "mixed race", "mixed race", "mixed race", "mixed race", "mixed race", "mixed race", "white", "white", "black")>>
<<elseif ($activeSlave.nationality is "Peruvian")>>
<<set $activeSlave.race to either("latina", "amerindian")>>
<<elseif ($activeSlave.nationality is "Venezuelan")>>
<<set $activeSlave.race to either("latina")>>
<<elseif ($activeSlave.nationality is "Bolivian")>>
<<set $activeSlave.race to either("latina", "amerindian")>>
<<elseif ($activeSlave.nationality is "Guatemalan")>>
<<set $activeSlave.race to either("latina", "amerindian")>>
<<elseif ($activeSlave.nationality is "Brazilian")>>
<<set $activeSlave.race to either("black", "latina", "mixed race", "mixed race", "amerindian", "white")>>
<<elseif ($activeSlave.nationality is "Argentinian")>>
<<set $activeSlave.race to either("white", "latina", "latina")>>
<<elseif ($activeSlave.nationality is "Chilean")>>
<<set $activeSlave.race to either("white", "latina", "latina", "latina")>>
<<elseif ($activeSlave.nationality is "Colombian")>>
<<set $activeSlave.race to either("latina")>>
<<elseif ($activeSlave.nationality is "Egyptian")>>
<<set $activeSlave.race to either("black", "middle eastern", "middle eastern", "middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "Turkish")>>
<<set $activeSlave.race to either("middle eastern", "middle eastern", "middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "Iranian")>>
<<set $activeSlave.race to either("indo-aryan", "indo-aryan", "indo-aryan", "semitic")>>
<<elseif ($activeSlave.nationality is "Armenian")>>
<<set $activeSlave.race to either("indo-aryan", "semitic")>>
<<elseif ($activeSlave.nationality is "Israeli")>>
<<set $activeSlave.race to either("white", "middle eastern", "semitic", "semitic")>>
<<elseif ($activeSlave.nationality is "Saudi")>>
<<set $activeSlave.race to either("black", "asian", "middle eastern", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Moroccan")>>
<<set $activeSlave.race to either("middle eastern", "middle eastern", "black")>>
<<elseif ($activeSlave.nationality is "Nigerian")>>
<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Kenyan")>>
<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Zimbabwean")>>
<<set $activeSlave.race to either("black", "black", "black", "black", "white")>>
<<elseif ($activeSlave.nationality is "Ugandan")>>
<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Tanzanian")>>
<<set $activeSlave.race to either("black", "black", "black", "semitic")>>
<<elseif ($activeSlave.nationality is "Ghanan")>>
<<set $activeSlave.race to either("black", "black", "black", "semitic")>>
<<elseif ($activeSlave.nationality is "Congolese")>>
<<set $activeSlave.race to either("black")>>
<<elseif ($activeSlave.nationality is "Ethiopian")>>
<<set $activeSlave.race to either("black", "black", "black", "middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "South African")>>
<<set $activeSlave.race to either("black", "black", "black", "white")>>
<<elseif ($activeSlave.nationality is "Chinese")>>
<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Korean")>>
<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Japanese")>>
<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Thai")>>
<<set $activeSlave.race to either("asian", "asian", "malay")>>
<<elseif ($activeSlave.nationality is "Vietnamese")>>
<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Indonesian")>>
<<set $activeSlave.race to either("asian", "malay", "malay", "pacific islander")>>
<<elseif ($activeSlave.nationality is "Filipina")>>
<<set $activeSlave.race to either("asian", "malay", "malay", "pacific islander")>>
<<elseif ($activeSlave.nationality is "Burmese")>>
<<set $activeSlave.race to either("asian", "asian", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Nepalese")>>
<<set $activeSlave.race to either("asian", "asian", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Uzbek")>>
<<set $activeSlave.race to either("asian")>>
<<elseif ($activeSlave.nationality is "Afghan")>>
<<set $activeSlave.race to either("indo-aryan", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Algerian")>>
<<set $activeSlave.race to either("middle eastern")>>
<<elseif ($activeSlave.nationality is "Libyan")>>
<<set $activeSlave.race to either("middle eastern")>>
<<elseif ($activeSlave.nationality is "Tunisian")>>
<<set $activeSlave.race to either("middle eastern")>>
<<elseif ($activeSlave.nationality is "Lebanese")>>
<<set $activeSlave.race to either("middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "Jordanian")>>
<<set $activeSlave.race to either("middle eastern", "semitic")>>
<<elseif ($activeSlave.nationality is "Emirati")>>
<<set $activeSlave.race to either("middle eastern", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Omani")>>
<<set $activeSlave.race to either("middle eastern", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Malian")>>
<<set $activeSlave.race to either("black", "black", "black", "black", "black", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Sudanese")>>
<<set $activeSlave.race to either("black", "black", "black", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Yemeni")>>
<<set $activeSlave.race to either("black", "semitic", "middle eastern", "middle eastern", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Iraqi")>>
<<set $activeSlave.race to either("semitic", "middle eastern", "middle eastern", "middle eastern", "middle eastern")>>
<<elseif ($activeSlave.nationality is "Indian")>>
<<set $activeSlave.race to either("indo-aryan")>>
<<elseif ($activeSlave.nationality is "Malaysian")>>
<<set $activeSlave.race to either("asian", "malay", "malay", "malay")>>
<<elseif ($activeSlave.nationality is "Kazakh")>>
<<set $activeSlave.race to either("asian", "asian", "asian", "semitic", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Pakistani")>>
<<set $activeSlave.race to either("indo-aryan", "indo-aryan", "indo-aryan", "semitic")>>
<<elseif ($activeSlave.nationality is "Bangladeshi")>>
<<set $activeSlave.race to either("indo-aryan")>>
<<elseif ($activeSlave.nationality is "Belarusian")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Russian")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Ukrainian")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Irish")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Icelandic")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Finnish")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Swiss")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Danish")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Norwegian")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Austrian")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Slovak")>>
<<set $activeSlave.race to either("white", "white", "white", "white", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Dutch")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Belgian")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Czech")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Serbian")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Portuguese")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Hungarian")>>
<<set $activeSlave.race to either("white", "white", "white", "white", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "Estonian")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Polish")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Lithuanian")>>
<<set $activeSlave.race to either("white")>>
<<elseif ($activeSlave.nationality is "Romanian")>>
<<set $activeSlave.race to either("semitic", "white", "white", "white", "white", "indo-aryan")>>
<<elseif ($activeSlave.nationality is "German")>>
<<set $activeSlave.race to either("black", "middle eastern", "white", "white", "white", "white", "white", "white")>>
<<elseif ($activeSlave.nationality is "Swedish")>>
<<set $activeSlave.race to either("middle eastern", "white", "white", "white", "white")>>
<<elseif ($activeSlave.nationality is "French")>>
<<set $activeSlave.race to either("black", "middle eastern", "white", "white", "white", "white", "white", "southern European")>>
<<elseif ($activeSlave.nationality is "Italian")>>
<<set $activeSlave.race to either("middle eastern", "southern European", "southern European", "white", "white")>>
<<elseif ($activeSlave.nationality is "Greek")>>
<<set $activeSlave.race to either("southern European")>>
<<elseif ($activeSlave.nationality is "Spanish")>>
<<set $activeSlave.race to either("semitic", "southern European", "southern European")>>
<<elseif ($activeSlave.nationality is "British")>>
<<set $activeSlave.race to either("indo-aryan", "white", "white", "white", "white", "white", "white", "white", "white", "white")>>
<<elseif ($activeSlave.nationality is "Scottish")>>
<<set $activeSlave.race to either("middle eastern", "indo-aryan", "white", "white", "white", "white", "white", "white", "white")>>
<<elseif ($activeSlave.nationality is "Australian")>>
<<set $activeSlave.race to either("white", "white", "black", "asian")>>
<<elseif ($activeSlave.nationality is "a New Zealander")>>
<<set $activeSlave.race to either("white", "white", "white", "white", "pacific islander")>>
<</if>>
/% Begin mixed race rate adjustment. %/
/% Some countries are extremely ethnically homogeneous and unlikely to change soon. %/
<<if ($activeSlave.nationality is "Japanese")>>
<<if random(1,100) > 98>>
<<set $activeSlave.race to "mixed race">>
<</if>>
<<elseif ($activeSlave.nationality is "Korean")>>
<<if random(1,100) > 95>>
<<set $activeSlave.race to "mixed race">>
<</if>>
<<elseif ($activeSlave.nationality is "Polish") or ($activeSlave.nationality is "Romanian") or ($activeSlave.nationality is "Bulgarian") or ($activeSlave.nationality is "Lithuanian") or ($activeSlave.nationality is "Croatian")>>
/% Croatia isn't an origin currently but the game might add it in the future. %/
<<if random(1,100) > 98>>
<<set $activeSlave.race to "mixed race">>
<</if>>
<<elseif random(1,100) > 90>>
/% Default rate. %/
<<set $activeSlave.race to "mixed race">>
<</if>>
/% End mixed race rate adjustment. %/
<<else>>
<<switch $fixedRace>>
<<case "white">>
<<set $activeSlave.nationality to $whiteNationalities.random()>>
<<case "asian">>
<<set $activeSlave.nationality to $asianNationalities.random()>>
<<case "latina">>
<<set $activeSlave.nationality to $latinaNationalities.random()>>
<<case "middle eastern">>
<<set $activeSlave.nationality to $middleEasternNationalities.random()>>
<<case "black">>
<<set $activeSlave.nationality to $blackNationalities.random()>>
<<case "indo-aryan">>
<<set $activeSlave.nationality to $indoAryan"Nationalities.random()>>
<<case "pacific islander">>
<<set $activeSlave.nationality to $pacificIslanderNationalities.random()>>
<<case "malay">>
<<set $activeSlave.nationality to $malayNationalities.random()>>
<<case "amerindian">>
<<set $activeSlave.nationality to $amerindianNationalities.random()>>
<<case "southern european">>
<<set $activeSlave.nationality to $southernEuropean"Nationalities.random()>>
<<case "semitic">>
<<set $activeSlave.nationality to $semiticNationalities.random()>>
<</switch>>
<<set $activeSlave.race = $fixedRace>>
<</if>>
<<if $arcologies[0].FSSupremacistLawME != 0>>
<<if $activeSlave.race == $arcologies[0].FSSupremacistRace>>
<<set $activeSlave.race to "mixed race">>
<</if>>
<</if>>
<</widget>>
<<widget "NationalityToName">>
<<if ($activeSlave.nationality is "American")>>
<<if $activeSlave.race is "black">>
<<set $activeSlave.birthName to $africanAmericanSlaveNames.random()>>
<<elseif $activeSlave.race is "latina">>
<<set $activeSlave.birthName to $latinaSlaveNames.random()>>
<<elseif $activeSlave.race is "asian">>
<<set $activeSlave.birthName to $asianAmericanSlaveNames.random()>>
<<elseif $activeSlave.race is "middle eastern">>
<<set $activeSlave.birthName to $egyptianSlaveNames.random()>>
<<else>>
<<set $activeSlave.birthName to $whiteAmericanSlaveNames.random()>>
<</if>>
<<case "Canadian">>
<<set $activeSlave.birthName to $canadianSlaveNames.random()>>
<<case "Mexican">>
<<set $activeSlave.birthName to $mexicanSlaveNames.random()>>
<<case "Dominican">>
<<set $activeSlave.birthName to $dominicanSlaveNames.random()>>
<<case "Puerto Rican">>
<<set $activeSlave.birthName to $puertoRicanSlaveNames.random()>>
<<case "Haitian">>
<<set $activeSlave.birthName to $haitianSlaveNames.random()>>
<<case "Jamaican">>
<<set $activeSlave.birthName to $jamaicanSlaveNames.random()>>
<<case "Cuban">>
<<set $activeSlave.birthName to $cubanSlaveNames.random()>>
<<case "Guatemalan">>
<<set $activeSlave.birthName to $guatemalanSlaveNames.random()>>
<<case "Chilean">>
<<set $activeSlave.birthName to $chileanSlaveNames.random()>>
<<case "Peruvian">>
<<set $activeSlave.birthName to $peruvianSlaveNames.random()>>
<<case "Bolivian">>
<<set $activeSlave.birthName to $bolivianSlaveNames.random()>>
<<case "Venezuelan">>
<<set $activeSlave.birthName to $venezuelanSlaveNames.random()>>
<<case "Belarusian">>
<<set $activeSlave.birthName to $belarusianSlaveNames.random()>>
<<case "Russian">>
<<set $activeSlave.birthName to $russianSlaveNames.random()>>
<<case "Ukrainian">>
<<set $activeSlave.birthName to $ukrainianSlaveNames.random()>>
<<case "Italian">>
<<set $activeSlave.birthName to $italianSlaveNames.random()>>
<<case "Spanish">>
<<set $activeSlave.birthName to $spanishSlaveNames.random()>>
<<case "British">>
<<set $activeSlave.birthName to $britishSlaveNames.random()>>
<<case "Scottish">>
<<set $activeSlave.birthName to $scottishSlaveNames.random()>>
<<case "French">>
<<set $activeSlave.birthName to $frenchSlaveNames.random()>>
<<case "German">>
<<set $activeSlave.birthName to $germanSlaveNames.random()>>
<<case "Lithuanian">>
<<set $activeSlave.birthName to $lithuanianSlaveNames.random()>>
<<case "Norwegian">>
<<set $activeSlave.birthName to $norwegianSlaveNames.random()>>
<<case "Slovak">>
<<set $activeSlave.birthName to $slovakSlaveNames.random()>>
<<case "Danish">>
<<set $activeSlave.birthName to $danishSlaveNames.random()>>
<<case "Dutch">>
<<set $activeSlave.birthName to $dutchSlaveNames.random()>>
<<case "Austrian">>
<<set $activeSlave.birthName to $austrianSlaveNames.random()>>
<<case "Swiss">>
<<set $activeSlave.birthName to $swissSlaveNames.random()>>
<<case "Serbian">>
<<set $activeSlave.birthName to $serbianSlaveNames.random()>>
<<case "Belgian">>
<<set $activeSlave.birthName to $belgianSlaveNames.random()>>
<<case "Czech">>
<<set $activeSlave.birthName to $czechSlaveNames.random()>>
<<case "Portuguese">>
<<set $activeSlave.birthName to $portugueseSlaveNames.random()>>
<<case "Swedish">>
<<set $activeSlave.birthName to $swedishSlaveNames.random()>>
<<case "Romanian">>
<<set $activeSlave.birthName to $romanianSlaveNames.random()>>
<<case "Hungarian">>
<<set $activeSlave.birthName to $hungarianSlaveNames.random()>>
<<case "Estonian">>
<<set $activeSlave.birthName to $estonianSlaveNames.random()>>
<<case "Irish">>
<<set $activeSlave.birthName to $irishSlaveNames.random()>>
<<case "Icelandic">>
<<set $activeSlave.birthName to $icelandicSlaveNames.random()>>
<<case "Finnish">>
<<set $activeSlave.birthName to $finnishSlaveNames.random()>>
<<case "Greek">>
<<set $activeSlave.birthName to $greekSlaveNames.random()>>
<<case "Polish">>
<<set $activeSlave.birthName to $polishSlaveNames.random()>>
<<case "Brazilian">>
<<set $activeSlave.birthName to $brazilianSlaveNames.random()>>
<<case "Egyptian">>
<<set $activeSlave.birthName to $egyptianSlaveNames.random()>>
<<case "Colombian">>
<<set $activeSlave.birthName to $colombianSlaveNames.random()>>
<<case "Argentinian">>
<<set $activeSlave.birthName to $argentinianSlaveNames.random()>>
<<case "Turkish">>
<<set $activeSlave.birthName to $turkishSlaveNames.random()>>
<<case "Iranian">>
<<set $activeSlave.birthName to $iranianSlaveNames.random()>>
<<case "Armenian">>
<<set $activeSlave.birthName to $armenianSlaveNames.random()>>
<<case "Israeli">>
<<set $activeSlave.birthName to $israeliSlaveNames.random()>>
<<case "Saudi">>
<<set $activeSlave.birthName to $saudiSlaveNames.random()>>
<<case "South African">>
<<if $activeSlave.race is "black">>
<<set $activeSlave.birthName to $blackSouthAfricanSlaveNames.random()>>
<<else>>
<<set $activeSlave.birthName to $whiteSouthAfricanSlaveNames.random()>>
<</if>>
<<case "Nigerian">>
<<set $activeSlave.birthName to $nigerianSlaveNames.random()>>
<<case "Congolese">>
<<set $activeSlave.birthName to $congoleseSlaveNames.random()>>
<<case "Kenyan">>
<<set $activeSlave.birthName to $kenyanSlaveNames.random()>>
<<case "Tanzanian">>
<<set $activeSlave.birthName to $tanzanianSlaveNames.random()>>
<<case "Zimbabwean">>
<<if $activeSlave.race == "white">>
<<set $activeSlave.birthName to $britishSlaveNames.random()>>
<<else>>
<<set $activeSlave.birthName to $zimbabweanSlaveNames.random()>>
<</if>>
<<case "Ghanan">>
<<set $activeSlave.birthName to $ghananSlaveNames.random()>>
<<case "Ugandan">>
<<set $activeSlave.birthName to $ugandanSlaveNames.random()>>
<<case "Ethiopian">>
<<set $activeSlave.birthName to $ethiopianSlaveNames.random()>>
<<case "Moroccan">>
<<set $activeSlave.birthName to $moroccanSlaveNames.random()>>
<<case "Chinese">>
<<set $activeSlave.birthName to $chineseSlaveNames.random()>>
<<case "Korean">>
<<set $activeSlave.birthName to $koreanSlaveNames.random()>>
<<case "Thai">>
<<set $activeSlave.birthName to $thaiSlaveNames.random()>>
<<case "Vietnamese">>
<<set $activeSlave.birthName to $vietnameseSlaveNames.random()>>
<<case "Japanese">>
<<set $activeSlave.birthName to $japaneseSlaveNames.random()>>
<<case "Indonesian">>
<<set $activeSlave.birthName to $indonesianSlaveNames.random()>>
<<case "Filipina">>
<<set $activeSlave.birthName to $filipinaSlaveNames.random()>>
<<case "Bangladeshi">>
<<set $activeSlave.birthName to $bangladeshiSlaveNames.random()>>
<<case "Malaysian">>
<<set $activeSlave.birthName to $malaysianSlaveNames.random()>>
<<case "Uzbek">>
<<set $activeSlave.birthName to $uzbekSlaveNames.random()>>
<<case "Afghan">>
<<set $activeSlave.birthName to $afghanSlaveNames.random()>>
<<case "Nepalese">>
<<set $activeSlave.birthName to $nepaleseSlaveNames.random()>>
<<case "Burmese">>
<<set $activeSlave.birthName to $burmeseSlaveNames.random()>>
<<case "Iraqi">>
<<set $activeSlave.birthName to $iraqiSlaveNames.random()>>
<<case "Yemeni">>
<<set $activeSlave.birthName to $yemeniSlaveNames.random()>>
<<case "Sudanese">>
<<set $activeSlave.birthName to $sudaneseSlaveNames.random()>>
<<case "Algerian">>
<<set $activeSlave.birthName to $algerianSlaveNames.random()>>
<<case "Tunisian">>
<<set $activeSlave.birthName to $tunisianSlaveNames.random()>>
<<case "Libyan">>
<<set $activeSlave.birthName to $libyanSlaveNames.random()>>
<<case "Omani">>
<<set $activeSlave.birthName to $omaniSlaveNames.random()>>
<<case "Malian">>
<<set $activeSlave.birthName to $malianSlaveNames.random()>>
<<case "Jordanian">>
<<set $activeSlave.birthName to $jordanianSlaveNames.random()>>
<<case "Lebanese">>
<<set $activeSlave.birthName to $lebaneseSlaveNames.random()>>
<<case "Emirati">>
<<set $activeSlave.birthName to $emiratiSlaveNames.random()>>
<<case "Kazakh">>
<<set $activeSlave.birthName to $kazakhSlaveNames.random()>>
<<case "Pakistani">>
<<set $activeSlave.birthName to $pakistaniSlaveNames.random()>>
<<case "Indian">>
<<set $activeSlave.birthName to $indianSlaveNames.random()>>
<<case "Australian">>
<<set $activeSlave.birthName to $australianSlaveNames.random()>>
<<case "a New Zealander">>
<<set $activeSlave.birthName to $newZealanderSlaveNames.random()>>
<<default>>
<<set $activeSlave.birthName to $whiteAmericanSlaveNames.random()>>
<</switch>>
<</widget>>
<<widget "NationalityToAccent">>
<<set $seed to either(0,1,1,2,2,2,3,3,3,3)>>
<<if ($activeSlave.nationality is "American")>>
<<if $activeSlave.race is "black">>
<<if $language is "English">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to either(0,1,1,2,2,2,3,3,3,3)>>
<</if>>
<<elseif $activeSlave.race is "latina">>
<<if $language is "English">>
<<set $activeSlave.accent to 0>>
<<elseif $language is "Spanish">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif $activeSlave.race is "asian">>
<<if $language is "English">>
<<set $activeSlave.accent to 0>>
<<elseif $language is "Chinese">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif $activeSlave.race is "middle eastern">>
<<if $language is "English">>
<<set $activeSlave.accent to 0>>
<<elseif $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<else>>
<<if $language is "English">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<</if>>
<<elseif ($activeSlave.nationality is "Canadian")>>
<<if $language is "English">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Mexican")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Dominican")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Puerto Rican")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Haitian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Jamaican")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Cuban")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Guatemalan")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Chilean")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Peruvian")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Bolivian")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Venezuelan")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Russian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Ukrainian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Italian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Spanish")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "British")>>
<<if $language is "English">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Scottish")>>
<<if $language is "English">>
<<set $activeSlave.accent to 2>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "French")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "German")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Lithuanian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Belarusian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "French")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "German")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Lithuanian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Norwegian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Slovak")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Danish")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Dutch")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Austrian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Swiss")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Serbian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Belgian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Czech")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Portuguese")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Swedish")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Romanian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Hungarian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Estonian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Irish")>>
<<if $language is "English">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Icelandic")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Finnish")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Greek")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Polish")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Brazilian")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Egyptian")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Colombian")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Argentinian")>>
<<if $language is "Spanish">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Turkish")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Iranian")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Armenian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Israeli")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Saudi")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "South African")>>
<<if $language is "English">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Nigerian")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Congolese")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Kenyan")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Tanzanian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Zimbabwean")>>
<<if $language is "English" && $activeSlave.race == "white">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Ghanan")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Ugandan")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Ethiopian")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Moroccan")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Chinese")>>
<<if $language is "Chinese">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Korean")>>
<<if $language is "Chinese">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Thai")>>
<<if $language is "Chinese">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Vietnamese")>>
<<if $language is "Chinese">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Japanese")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Indonesian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Filipina")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Bangladeshi")>>
<<if $language is "Indian">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Malaysian")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Uzbek")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Afghan")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Nepalese")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Burmese")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Iraqi")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Yemeni")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Sudanese")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Algerian")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Tunisian")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Libyan")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Omani")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Malian")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Jordanian")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Lebanese")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Emirati")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Kazakh")>>
<<set $activeSlave.accent to $seed>>
<<elseif ($activeSlave.nationality is "Pakistani")>>
<<if $language is "Arabic">>
<<set $activeSlave.accent to either(0,1,2,3)>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Indian")>>
<<if $language is "Indian">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "Australian")>>
<<if $language is "English">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif ($activeSlave.nationality is "a New Zealander")>>
<<if $language is "English">>
<<set $activeSlave.accent to 1>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif $activeSlave.nationality is "Roman Revivalist">>
<<if $language is "Latin">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif $activeSlave.nationality is "Ancient Egyptian Revivalist">>
<<if $language is "Ancient Egyptian">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif $activeSlave.nationality is "Edo Revivalist">>
<<if $language is "Japanese">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif $activeSlave.nationality is "Arabian Revivalist">>
<<if $language is "Arabic">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<elseif $activeSlave.nationality is "Ancient Chinese Revivalist">>
<<if $language is "Chinese">>
<<set $activeSlave.accent to 0>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<else>>
<<set $activeSlave.accent to $seed>>
<</if>>
<<if $activeSlave.nationality is $language>>
<<set $activeSlave.accent to 0>>
<</if>>
<</widget>>
|
r3d/fc
|
devNotes/Slave Generation Widgets.txt
|
Text
|
bsd-3-clause
| 36,597
|
########################################################################################################################
#
# sugarcube-2.py
#
# Copyright (c) 2013-2017 Thomas Michael Edwards <tmedwards@motoslave.net>. All rights reserved.
# Use of this source code is governed by a Simplified BSD License which can be found in the LICENSE file.
#
########################################################################################################################
import os, os.path, header
from collections import OrderedDict
class Header (header.Header):
def filesToEmbed(self):
userLibPath = self.path + os.sep + 'userlib.js'
if os.path.isfile(userLibPath):
return OrderedDict([
('"USER_LIB"', userLibPath)
])
else:
return OrderedDict()
def storySettings(self):
return "SugarCube 2.x does not support the StorySettings special passage.\n\nInstead, you should use its configuration object, config.\n See: http://www.motoslave.net/sugarcube/2/docs/config-object.html"
def isEndTag(self, name, tag):
return (name == ('/' + tag) or name == ('end' + tag))
def nestedMacros(self):
return [
# standard macros
'append',
'button',
'capture',
'createplaylist',
'for',
'if',
'link',
'linkappend',
'linkprepend',
'linkreplace',
'nobr',
'prepend',
'repeat',
'replace',
'script',
'switch',
'silently',
'timed',
'widget',
# deprecated macros
'click'
]
def passageTitleColor(self, passage):
additionalSpecialPassages = [
'PassageDone',
'PassageFooter',
'PassageHeader',
'PassageReady',
'StoryBanner',
'StoryCaption',
'StoryShare'
]
if passage.isStylesheet():
return ((111, 49, 83), (234, 123, 184))
elif passage.isScript():
return ((89, 66, 28), (226, 170, 80))
elif ('widget' in passage.tags):
return ((80, 106, 26), (134, 178, 44))
elif passage.isInfoPassage() or (passage.title in additionalSpecialPassages):
return ((28, 89, 74), (41, 214, 113))
elif passage.title == 'Start':
return ('#4ca333', '#4bdb24')
def passageChecks(self):
return super(Header, self).passageChecks()
|
r3d/fc
|
devTools/tweeGo/targets/sugarcube-2/sugarcube-2.py
|
Python
|
bsd-3-clause
| 2,163
|
How to mod (basic doc):
1. All sources now in the src subdir, in separate files. 1 passage = 1 file.
2. Special files and dir's:
- src/config - configuration of the story is here.
- src/config/start.tw - contains list of .tw passage files, regenerated automatic, by building scripts. Do not change by hands. (origial passage Start from pregmod renamed and moved to src/events/intro/introSummary.tw)
- src/js/storyJS.tw - special passage with [script] tag - contain all native JavaScript from pregmod.
- devTools/tweeGo/targets/sugarcube-2/userlib.js - on original FC JS moved here (I deleted it after moving JS to storyJS.tw). Compare to storyJS.tw but do not copy file here. May conflict with src/js/storyJS.tw if copied.
- src/pregmod - I put all pregmod-only passages here.
- .gitignore - special file for git - to ignore some files. For example - compilation results or this file.
3. Compilation:
Windows:
Run compile.bat - result will be file bin/FC.html
Second run of compile.but will overwrite bin/FC.html without prompt.
Linux:
Ensure executable permission on file "devTools/tweeGo/tweego" (not tweego.exe!)
Ensure executable permission on file "compile"
In the root dir of sources (where you see src, devTools, bin...) run command "./compile" from console
compile-git will produce the same result file but with current commit hash in filename.
4. Simple comparing and merging with original FC:
Use meld tool. Place folder FreeCities (original FC sources tree) near FreeCitiesPregmod (this sources tree) and use command:
meld FreeCities FreeCitiesPregmod
or just select these folders in meld's GUI.
5. All modders will be wery grateful if any, who make some changes to game, with .html file also post his/her resulting src folder tree.
6. For contributors to pregmod: you need to post yours version of src folder tree, not just produced FC_pregmod.html !!! This html file can't be reverted to proper sources, and useless as contribution!
|
r3d/fc
|
readme.txt
|
Text
|
bsd-3-clause
| 2,046
|
:: MOD_Edit Arcology Cheat [nobr]
<<set $nextButton to "Continue">>
<<set $nextLink to "MOD_Edit Arcology Cheat Datatype Cleanup">>
<<set $PC.actualAge to Math.clamp($PC.actualAge, 18, 80)>>
''Cheating Edit Arcology''
<<if ($economy != 1) || ($seeDicks != 25) || ($continent != "North America") || ($internationalTrade != 1) || ($internationalVariety != 1) || ($seeRace != 1) || ($seeNationality != 1) || ($seeExtreme != 0) || ($plot != 1)>>
//[[restore defaults|MOD_Edit Arcology Cheat][$seeDicks to 25,$economy to 1,$continent to "North America",$internationalTrade to 1,$internationalVariety to 1,$seeRace to 1,$seeNationality to 1,$seeExtreme to 0,$plot to 1]]//
<</if>>
<br><br>
<<if $economy == 1>>
The world economy is in ''doubtful'' shape.
[[Easier|MOD_Edit Arcology Cheat][$economy to 0.5]] | [[Harder|MOD_Edit Arcology Cheat][$economy to 1.5]]
<<elseif $economy < 1>>
The world economy is still in ''good'' shape.
[[Harder|MOD_Edit Arcology Cheat][$economy to 1]]
<<else>>
The world economy is in ''terrible'' shape.
[[Easier|MOD_Edit Arcology Cheat][$economy to 1]]
<</if>>
<<set $drugsCost = Math.trunc(100*$economy)>>
<<set $rulesCost = Math.trunc(100*$economy)>>
<<set $modCost = Math.trunc(50*$economy)>>
<<set $surgeryCost = Math.trunc(300*$economy)>>
<br>
The arcology is located in ''$continent''.
[[North America|MOD_Edit Arcology Cheat][$continent to "North America", $language to "English"]] | [[South America|MOD_Edit Arcology Cheat][$continent to "South America", $language to "Spanish"]] | [[Europe|MOD_Edit Arcology Cheat][$continent to "Europe", $language to "English"]] | [[the Middle East|MOD_Edit Arcology Cheat][$continent to "the Middle East", $language to "Arabic"]] | [[Africa|MOD_Edit Arcology Cheat][$continent to "Africa", $language to "Arabic"]] | [[Asia|MOD_Edit Arcology Cheat][$continent to "Asia", $language to "Chinese"]] | [[Australia|MOD_Edit Arcology Cheat][$continent to "Australia", $language to "English"]] | [[Japan|MOD_Edit Arcology Cheat][$continent to "Japan", $language to "Japanese"]]
<br>
The lingua franca of the arcology is ''$language''.
<<if $language != "English">>
[[English|MOD_Edit Arcology Cheat][$language to "English"]] |
<<else>>
English |
<</if>>
<<if $language != "Spanish">>
[[Spanish|MOD_Edit Arcology Cheat][$language to "Spanish"]] |
<<else>>
Spanish |
<</if>>
<<if $language != "Arabic">>
[[Arabic|MOD_Edit Arcology Cheat][$language to "Arabic"]] |
<<else>>
Arabic |
<</if>>
<<if $language != "Chinese">>
[[Chinese|MOD_Edit Arcology Cheat][$language to "Chinese"]] |
<<else>>
Chinese |
<</if>>
Custom: <<textbox "$language" $language "MOD_Edit Arcology Cheat">>
<br><br>
<<if $internationalTrade == 0>>
The slave trade is ''continental,'' so a narrower variety of slaves will be available.
[[Allow intercontinental trade|MOD_Edit Arcology Cheat][$internationalTrade to 1]]
<<else>>
The slave trade is ''international,'' so a wider variety of slaves will be available.
[[Restrict the trade to continental|MOD_Edit Arcology Cheat][$internationalTrade to 0]]
<</if>>
<br>
<<if $internationalTrade == 1>>
<<if $internationalVariety == 0>>
International slave variety is ''semi-realistic,'' so more populous nations will be more common.
[[Normalized national variety|MOD_Edit Arcology Cheat][$internationalVariety to 1]]
<<else>>
International slave variety is ''normalized,'' so small nations will appear nearly as much as large ones.
[[Semi-realistic national variety|MOD_Edit Arcology Cheat][$internationalVariety to 0]]
<</if>>
<</if>>
<br>
<<if $seeRace == 1>>
Ethnicity will ''occasionally'' be mentioned.
[[Disable most mentions of race|MOD_Edit Arcology Cheat][$seeRace to 0]]
<<else>>
Ethnicity will ''almost never'' be mentioned.
[[Enable mentions of race|MOD_Edit Arcology Cheat][$seeRace to 1]]
<</if>>
<br>
<<if $seeNationality == 1>>
Nationality will ''occasionally'' be mentioned.
[[Disable most mentions of nationality|MOD_Edit Arcology Cheat][$seeNationality to 0]]
<<else>>
Nationality will ''almost never'' be mentioned.
[[Enable mentions of nationality|MOD_Edit Arcology Cheat][$seeNationality to 1]]
<</if>>
<br>
<<if $seeExtreme == 1>>
Extreme content like amputation is ''enabled''.
[[Disable|MOD_Edit Arcology Cheat][$seeExtreme to 0]]
<<else>>
Extreme content like amputation is ''disabled''.
[[Enable|MOD_Edit Arcology Cheat][$seeExtreme to 1]]
<</if>>
<br>
<<if ($weightAffectsAssets != 0)>>
Slave assets affected by weight is ''enabled''. [[Disable|MOD_Edit Arcology Cheat][$weightAffectsAssets to 0]]
<<else>>
Slave assets affected by weight is ''disabled''. [[Enable|MOD_Edit Arcology Cheat][$weightAffectsAssets to 1]]
<</if>> //If enabled, thin slaves will have large assets drop in size and vice versa at week end. (Diet still affects asset sizes).//
<br>
<<if ($curativeSideEffects != 0)>>
Curative side effects are ''enabled''. [[Disable|MOD_Edit Arcology Cheat][$curativeSideEffects to 0]]
<<else>>
Curative side effects are ''disabled''. [[Enable|MOD_Edit Arcology Cheat][$curativeSideEffects to 1]]
<</if>> //If enabled, curatives have a chance to give slaves harmful side effects.//
<br>
Slave girls will
<<if $seeDicks >= 90>>
''almost always'' have dicks.
[[No chicks with dicks pls (0%)|MOD_Edit Arcology Cheat][$seeDicks to 0]]
| [[Side order of girl dick (25%)|MOD_Edit Arcology Cheat][$seeDicks to 25]]
| [[Balanced dick chick diet (50%)|MOD_Edit Arcology Cheat][$seeDicks to 50]]
| [[Dickgirl main course (75%)|MOD_Edit Arcology Cheat][$seeDicks to 75]]
<<elseif $seeDicks > 50>>
''more likely than not'' have dicks.
[[No chicks with dicks pls (0%)|MOD_Edit Arcology Cheat][$seeDicks to 0]]
| [[Side order of girl dick (25%)|MOD_Edit Arcology Cheat][$seeDicks to 25]]
| [[Balanced dick chick diet (50%)|MOD_Edit Arcology Cheat][$seeDicks to 50]]
| [[All of the dicks (100%)|MOD_Edit Arcology Cheat][$seeDicks to 100]]
<<elseif $seeDicks > 25>>
''occasionally'' have dicks.
[[No chicks with dicks pls (0%)|MOD_Edit Arcology Cheat][$seeDicks to 0]]
| [[Side order of girl dick (25%)|MOD_Edit Arcology Cheat][$seeDicks to 25]]
| [[Dickgirl main course (75%)|MOD_Edit Arcology Cheat][$seeDicks to 75]]
| [[All of the dicks (100%)|MOD_Edit Arcology Cheat][$seeDicks to 100]]
<<elseif $seeDicks > 0>>
''rarely'' have dicks.
[[No chicks with dicks pls (0%)|MOD_Edit Arcology Cheat][$seeDicks to 0]]
| [[Balanced dick chick diet (50%)|MOD_Edit Arcology Cheat][$seeDicks to 50]]
| [[Dickgirl main course (75%)|MOD_Edit Arcology Cheat][$seeDicks to 75]]
| [[All of the dicks (100%)|MOD_Edit Arcology Cheat][$seeDicks to 100]]
<<else>>
''almost never'' have dicks.
[[Side order of girl dick (25%)|MOD_Edit Arcology Cheat][$seeDicks to 25]]
| [[Balanced dick chick diet (50%)|MOD_Edit Arcology Cheat][$seeDicks to 50]]
| [[Dickgirl main course (75%)|MOD_Edit Arcology Cheat][$seeDicks to 75]]
| [[All of the dicks (100%)|MOD_Edit Arcology Cheat][$seeDicks to 100]]
<</if>>
<<link "Go your own dick way">>
<<textbox "$seeDicks" $seeDicks>>
[[Apply|MOD_Edit Arcology Cheat][$seeDicks to Number($seeDicks)]]
<</link>>
<br>
<<if $plot == 1>>
Game mode: ''two-handed''. Includes non-erotic events concerning the changing world.
[[Disable non-erotic events|MOD_Edit Arcology Cheat][$plot to 0]]
<<else>>
Game mode: ''one-handed''. No non-erotic events concerning the changing world.
[[Enable non-erotic events|MOD_Edit Arcology Cheat][$plot to 1]]
<</if>>
<br><br>
/*<<nobr>>
<<if $normalizedEvents == 1>>
Random events distribution: ''normalized''. Random events will happen with equal frequency.
[[Realistic|MOD_Edit Arcology Cheat][$normalizedEvents to 0]]
<<else>>
Random events distribution: ''realistic''. Events will happen more frequently if more slaves qualify for them.
[[Normalize|MOD_Edit Arcology Cheat][$normalizedEvents to 1]]
<</if>>
<</nobr>>*/
__Player Character__
<br>
<<if $PC.title gt 0>>
Conversational title: ''Master''.
[[Switch to Mistress|MOD_Edit Arcology Cheat][$PC.title to 0]]
<<else>>
Conversational title: ''Mistress''.
[[Switch to Master|MOD_Edit Arcology Cheat][$PC.title to 1]]
<</if>>
<br>
Career: ''$PC.career''.
[[Wealth|MOD_Edit Arcology Cheat][$PC.career to "wealth"]] |
[[Business|MOD_Edit Arcology Cheat][$PC.career to "capitalist"]] |
[[PMC work|MOD_Edit Arcology Cheat][$PC.career to "mercenary"]] |
[[Slaving|MOD_Edit Arcology Cheat][$PC.career to "slaver"]] |
[[Engineering|MOD_Edit Arcology Cheat][$PC.career to "engineer"]] |
[[Medicine|MOD_Edit Arcology Cheat][$PC.career to "medicine"]] |
[[Celebrity|MOD_Edit Arcology Cheat][$PC.career to "celebrity"]]
<br>
Method of acquiring the arcology: ''$PC.rumor''.
[[Wealth|MOD_Edit Arcology Cheat][$PC.rumor to "wealth"]] |
[[Hard work|MOD_Edit Arcology Cheat][$PC.rumor to "diligence"]] |
[[Force|MOD_Edit Arcology Cheat][$PC.rumor to "force"]] |
[[Social engineering|MOD_Edit Arcology Cheat][$PC.rumor to "social engineering"]] |
[[Luck|MOD_Edit Arcology Cheat][$PC.rumor to "luck"]]
<br>
<<if $PC.dick gt 0>>
Genitalia: ''penis''. Standard sex scenes; easier reputation maintenance.
[[Switch to vagina|MOD_Edit Arcology Cheat][$PC.dick to 0]]
<<else>>
Genitalia: ''vagina''. Sex scene variations; more difficult reputation maintenance.
[[Switch to penis|MOD_Edit Arcology Cheat][$PC.dick to 1]]
<</if>>
<br>
<<if $PC.boobs gt 0>>
Chest: ''breasts''. Sex scene variations; more difficult reputation maintenance.
[[Remove breasts|MOD_Edit Arcology Cheat][$PC.boobs to 0]]
<<else>>
Chest: ''masculine''. Standard sex scenes; easier reputation maintenance.
[[Add breasts|MOD_Edit Arcology Cheat][$PC.boobs to 1]]
<</if>>
<br>
Age:
<<if $PC.actualAge >= 65>>
''old''.
<<elseif $PC.actualAge >= 50>>
''well into middle age''.
<<elseif $PC.actualAge >= 35>>
''entering middle age''.
<<else>>
''surprisingly young''.
<</if>>
<<textbox "$PC.actualAge" $PC.actualAge "MOD_Edit Arcology Cheat">>
<<set $PC.physicalAge = $PC.actualAge, $PC.visualAge = $PC.actualAge>>
<br>
<<if $playerAging == 2>>
You will ''age naturally.''
[[Disable aging|MOD_Edit Arcology Cheat][$playerAging to 0]] |
[[Semi aging|MOD_Edit Arcology Cheat][$playerAging to 1]]
<<elseif $playerAging == 1>>
You ''will'' celebrate birthdays, but ''not age.''
[[Enable aging fully|MOD_Edit Arcology Cheat][$playerAging to 2]] |
[[Disable aging|MOD_Edit Arcology Cheat][$playerAging to 0]]
<<else>>
You will ''not age,'' and not experience birthdays.
[[Enable aging|MOD_Edit Arcology Cheat][$playerAging to 2]] |
[[Semi aging|MOD_Edit Arcology Cheat][$playerAging to 1]]
<</if>>
//This option cannot be changed during the game//
<br>
Rename your character: <<textbox "$PCName" $PCName "MOD_Edit Arcology Cheat">>
<br>
Nationality: ''$PC.nationality''.<<textbox "$PC.nationality" $PC.nationality "MOD_Edit Arcology Cheat">>
<br>
Race: ''$PC.race''.
[[White|MOD_Edit Arcology Cheat][$PC.race to "white"]] |
[[Asian|MOD_Edit Arcology Cheat][$PC.race to "asian"]] |
[[Latina|MOD_Edit Arcology Cheat][$PC.race to "latina"]] |
[[Middle Eastern|MOD_Edit Arcology Cheat][$PC.race to "middle eastern"]] |
[[Black|MOD_Edit Arcology Cheat][$PC.race to "black"]] |
[[Semitic|MOD_Edit Arcology Cheat][$PC.race to "semitic"]] |
[[Southern European|MOD_Edit Arcology Cheat][$PC.race to "southern european"]] |
[[Indo-aryan|MOD_Edit Arcology Cheat][$PC.race to "indo-aryan"]] |
[[Amerindian|MOD_Edit Arcology Cheat][$PC.race to "amerindien"]] |
[[Pacific Islander|MOD_Edit Arcology Cheat][$PC.race to "pacific islander"]] |
[[Malay|MOD_Edit Arcology Cheat][$PC.race to "malay"]] |
[[Mixed Race|MOD_Edit Arcology Cheat][$PC.race to "mixed race"]]
<br>
Skin: ''$PC.skin''.
[[White|MOD_Edit Arcology Cheat][$PC.skin to "white"]] |
[[Fair|MOD_Edit Arcology Cheat][$PC.skin to "fair"]] |
[[Light|MOD_Edit Arcology Cheat][$PC.skin to "light"]] |
[[Dark|MOD_Edit Arcology Cheat][$PC.skin to "dark"]] |
[[Olive|MOD_Edit Arcology Cheat][$PC.skin to "olive"]] |
[[Black|MOD_Edit Arcology Cheat][$PC.skin to "black"]] |
[[Light Brown|MOD_Edit Arcology Cheat][$PC.skin to "light brown"]] |
[[Brown|MOD_Edit Arcology Cheat][$PC.skin to "brown"]] |
[[Pale|MOD_Edit Arcology Cheat][$PC.skin to "pale"]] |
[[Extremely Pale|MOD_Edit Arcology Cheat][$PC.skin to "extremely pale"]]
<br>
Eye color: ''$PC.eyeColor''.
<<textbox "$PC.eyeColor" $PC.eyeColor "MOD_Edit Arcology Cheat">>
<br>
Hair color: ''$PC.hColor''.
<<textbox "$PC.hColor" $PC.hColor "MOD_Edit Arcology Cheat">>
<br>
<br>
Preferred refreshment: <<textbox "$PC.refreshment" $PC.refreshment "MOD_Edit Arcology Cheat">> [[Cigars|MOD_Edit Arcology Cheat][$PC.refreshment to "cigar",$PC.refreshmentType = 0]] | [[Whiskey|MOD_Edit Arcology Cheat][$PC.refreshment to "whiskey",$PC.refreshmentType = 1]]
<br>
Preferred method of consumption: <<if $PC.refreshmentType == 0>>Smoked<<elseif $PC.refreshmentType == 1>>Drank<<elseif $PC.refreshmentType == 2>>Eaten<<elseif $PC.refreshmentType == 3>>Snorted<<else>>Injected<</if>>
<br>
[[Smoked|MOD_Edit Arcology Cheat][$PC.refreshmentType = 0]] | [[Drank|MOD_Edit Arcology Cheat][$PC.refreshmentType = 1]] | [[Eaten|MOD_Edit Arcology Cheat][$PC.refreshmentType = 2]] | [[Snorted|MOD_Edit Arcology Cheat][$PC.refreshmentType = 3]] | [[Injected|MOD_Edit Arcology Cheat][$PC.refreshmentType = 4]]
<br><br>
Arcology citizens: $ACitizens
<<textbox "$ACitizens" $ACitizens>>
<br>
Arcology sex slaves: $ASlaves
<<textbox "$ASlaves" $ASlaves>>
<br>
Arcology menial slaves: $AHelots
<<textbox "$AHelots" $AHelots>>
<br>
Arcology prosperity cap: $AProsperityCap
<<textbox "$AProsperityCap" $AProsperityCap>>
<br><br>
Shelter Abuse Counter: $shelterAbuse
<<textbox "$shelterAbuse" $shelterAbuse>>
<br><br>
''The Slavegirl School:''
<br>
TSS Students Bought: <<textbox "$TSS.studentsBought" $TSS.studentsBought>>
<br>
TSS Upgrades: ''$TSS.schoolUpgrade'' |
<<radiobutton "$TSS.schoolUpgrade" 0>> 0
| <<radiobutton "$TSS.schoolUpgrade" 1>> 1
| <<radiobutton "$TSS.schoolUpgrade" 2>> 2
<br>
TSS Moved to Arcology: ''$TSS.schoolPresent'' |
<<radiobutton "$TSS.schoolPresent" 0>> 0
| <<radiobutton "$TSS.schoolPresent" 1>> 1 (Moved)
<br>
TSS Prosperity: <<textbox "$TSS.schoolProsperity" $TSS.schoolProsperity>>
<br>
TSS Failed: ''$TSS.schoolAnnexed'' |
<<radiobutton "$TSS.schoolAnnexed" 0>> 0
| <<radiobutton "$TSS.schoolAnnexed" 1>> 1 (Failed)
<br><br>
''The Growth Research Institute:''
<br>
GRI Students Bought: <<textbox "$GRI.studentsBought" $GRI.studentsBought>>
<br>
GRI Upgrades: ''$GRI.schoolUpgrade'' |
<<radiobutton "$GRI.schoolUpgrade" 0>> 0
| <<radiobutton "$GRI.schoolUpgrade" 1>> 1
| <<radiobutton "$GRI.schoolUpgrade" 2>> 2
<br>
GRI Moved to Arcology: ''$GRI.schoolPresent'' |
<<radiobutton "$GRI.schoolPresent" 0>> 0
| <<radiobutton "$GRI.schoolPresent" 1>> 1 (Moved)
<br>
GRI Prosperity: <<textbox "$GRI.schoolProsperity" $GRI.schoolProsperity>>
<br>
GRI Failed: ''$GRI.schoolAnnexed'' |
<<radiobutton "$GRI.schoolAnnexed" 0>> 0
| <<radiobutton "$GRI.schoolAnnexed" 1>> 1 (Failed)
<br><br>
''St. Claver Preparatory:''
<br>
SCP Students Bought: <<textbox "$SCP.studentsBought" $SCP.studentsBought>>
<br>
SCP Upgrades: ''$SCP.schoolUpgrade'' |
<<radiobutton "$SCP.schoolUpgrade" 0>> 0
| <<radiobutton "$SCP.schoolUpgrade" 1>> 1
| <<radiobutton "$SCP.schoolUpgrade" 2>> 2
<br>
SCP Moved to Arcology: ''$SCP.schoolPresent'' |
<<radiobutton "$SCP.schoolPresent" 0>> 0
| <<radiobutton "$SCP.schoolPresent" 1>> 1 (Moved)
<br>
SCP Prosperity: <<textbox "$SCP.schoolProsperity" $SCP.schoolProsperity>>
<br>
SCP Failed: ''$SCP.schoolAnnexed'' |
<<radiobutton "$SCP.schoolAnnexed" 0>> 0
| <<radiobutton "$SCP.schoolAnnexed" 1>> 1 (Failed)
<<if ($seeDicks != 0)>>
<br><br>
''L'Ecole des Enculees:''
<br>
LDE Students Bought: <<textbox "$LDE.studentsBought" $LDE.studentsBought>>
<br>
LDE Upgrades: ''$LDE.schoolUpgrade'' |
<<radiobutton "$LDE.schoolUpgrade" 0>> 0
| <<radiobutton "$LDE.schoolUpgrade" 1>> 1
| <<radiobutton "$LDE.schoolUpgrade" 2>> 2
<br>
LDE Moved to Arcology: ''$LDE.schoolPresent'' |
<<radiobutton "$LDE.schoolPresent" 0>> 0
| <<radiobutton "$LDE.schoolPresent" 1>> 1 (Moved)
<br>
LDE Prosperity: <<textbox "$LDE.schoolProsperity" $LDE.schoolProsperity>>
<br>
LDE Failed: ''$LDE.schoolAnnexed'' |
<<radiobutton "$LDE.schoolAnnexed" 0>> 0
| <<radiobutton "$LDE.schoolAnnexed" 1>> 1 (Failed)
<br><br>
''The Gymnasium-Academy:''
<br>
TGA Students Bought: <<textbox "$TGA.studentsBought" $TGA.studentsBought>>
<br>
TGA Upgrades: ''$TGA.schoolUpgrade''
<<radiobutton "$TGA.schoolUpgrade" 0>> 0
| <<radiobutton "$TGA.schoolUpgrade" 1>> 1
| <<radiobutton "$TGA.schoolUpgrade" 2>> 2
<br>
TGA Moved to Arcology: ''$TGA.schoolPresent'' |
<<radiobutton "$TGA.schoolPresent" 0>> 0
| <<radiobutton "$TGA.schoolPresent" 1>> 1 (Moved)
<br>
TGA Prosperity: <<textbox "$TGA.schoolProsperity" $TGA.schoolProsperity>>
<br>
TGA Failed: ''$TGA.schoolAnnexed'' |
<<radiobutton "$TGA.schoolAnnexed" 0>> 0
| <<radiobutton "$TGA.schoolAnnexed" 1>> 1 (Failed)
<br><br>
''The Futanari Sisters:''
<br>
TFS Students Bought: <<textbox "$TFS.studentsBought" $TFS.studentsBought>>
<br>
TFS Upgrades: ''$TFS.schoolUpgrade'' |
<<radiobutton "$TFS.schoolUpgrade" 0>> 0
| <<radiobutton "$TFS.schoolUpgrade" 1>> 1
| <<radiobutton "$TFS.schoolUpgrade" 2>> 2
<br>
TFS Moved to Arcology: ''$TFS.schoolPresent'' |
<<radiobutton "$TFS.schoolPresent" 0>> 0
| <<radiobutton "$TFS.schoolPresent" 1>> 1 (Moved)
<br>
TFS Prosperity:<<textbox "$TFS.schoolProsperity" $TFS.schoolProsperity>>
<br>
TFS Failed: ''$TFS.schoolAnnexed'' |
<<radiobutton "$TFS.schoolAnnexed" 0>> 0
| <<radiobutton "$TFS.schoolAnnexed" 1>> 1 (Failed)
<</if>>
<br><br>
__Arcologies:__
<br> __''$arcologies[0].name''__ is your arcology.
<br>
You own: ''$arcologies[0].ownership%'' of the arcology <<textbox "$arcologies[0].ownership" $arcologies[0].ownership>>
<br>
Other minority ownership: ''$arcologies[0].minority%'' <<textbox "$arcologies[0].minority" $arcologies[0].minority>>
<br>
$arcologies[0].name's GSP is
@@color:yellowgreen;¤<<print Math.trunc(0.1*$arcologies[0].prosperity)>>m@@.
<<if $arcologies.length > 1>>
<<set _neighbors to Number($arcologies.length-1)>>
<br><br>
Your arcology has <<print Number($arcologies.length-1)>>
<<if _neighbors == 1>> neighbor<<else>> neighbors<</if>>.
<<else>>
Your arcology has no neighbors.
<</if>>
<<if $arcologies.length < 8>>
<<link "Add neighbor">>
<<set $seed to ["north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest"]>>
<<set $activeArcology to {name: "Arcology X-", direction: "north", government: "an individual", honeymoon: 0, prosperity: 50, ownership: 50, minority: 20, PCminority: 0, demandFactor:0, FSSupremacist: "unset", FSSupremacistRace: 0, FSSubjugationist: "unset", FSSubjugationistRace: 0, FSGenderRadicalist: "unset", FSGenderFundamentalist: "unset", FSPaternalist: "unset", FSDegradationist: "unset", FSBodyPurist: "unset", FSTransformationFetishist: "unset", FSYouthPreferentialist: "unset", FSMaturityPreferentialist: "unset", FSSlimnessEnthusiast: "unset", FSAssetExpansionist: "unset", FSPastoralist: "unset", FSPhysicalIdealist: "unset", FSChattelReligionist: "unset", FSRomanRevivalist: "unset", FSEgyptianRevivalist: "unset", FSEdoRevivalist: "unset", FSArabianRevivalist: "unset", FSChineseRevivalist: "unset", FSNull: "unset", embargo: 1, embargoTarget: -1, influenceTarget: -1, influenceBonus: 0, rival: 0}>>
<<if $arcologies.length < 4>>
<<set $activeArcology.name to $activeArcology.name+$arcologies.length>>
<<else>>
<<set $activeArcology.name to $activeArcology.name+($arcologies.length+1)>>
<</if>>
<<set $activeArcology.direction to $seed.pluck()>>
<<set $activeArcology.government to random(0,5)>>
<<set $activeArcology.prosperity += random(-20,20)>>
<<set $activeArcology.ownership += random(-10,0)>>
<<set $activeArcology.minority += random(-5,5)>>
<<set $arcologies.push($activeArcology)>>
<<goto "MOD_Edit Arcology Cheat">>
<</link>>
<</if>>
<br>
<<set $averageProsperity to 0>>
<<set $seed to 0>>
<<for $i to 0; $i lt $arcologies.length; $i++>>
<<set $averageProsperity += $arcologies[$i].prosperity>>
<<set $seed += 1>>
<</for>>
<<set $averageProsperity to $averageProsperity/$seed>>
<<for $i to 0; $i < $arcologies.length; $i++>>
<<if $arcologies[$i].direction != 0>>
<<display "Neighbor Description">>
<</if>>
<<if $i != 0>>
<<print "[[Remove neighbor|MOD_Edit Arcology Cheat][$arcologies.pluck( [" + $i + "], [" + $i + "] )]]">>
<</if>>
<</for>>
|
r3d/fc
|
src/cheats/mod_EditArcologyCheat.tw
|
tw
|
bsd-3-clause
| 20,488
|
:: MOD_Edit Arcology Cheat Datatype Cleanup
<<nobr>>
<<set $nextButton to "Continue">>
<<set $nextLink to "Manage Arcology">>
<<set $ACitizens to Number($ACitizens)>>
<<set $ASlaves to Number($ASlaves)>>
<<set $AHelots to Number($AHelots)>>
<<set $shelterAbuse to Number($shelterAbuse)>>
<<set $TSS.studentsBought to Number($TSS.studentsBought)>>
<<set $TSS.schoolProsperity to Number($TSS.schoolProsperity)>>
<<set $GRI.studentsBought to Number($GRI.studentsBought)>>
<<set $GRI.schoolProsperity to Number($GRI.schoolProsperity)>>
<<set $SCP.studentsBought to Number($SCP.studentsBought)>>
<<set $SCP.schoolProsperity to Number($SCP.schoolProsperity)>>
<<set $LDE.studentsBought to Number($LDE.studentsBought)>>
<<set $LDE.schoolProsperity to Number($LDE.schoolProsperity)>>
<<set $TGA.studentsBought to Number($TGA.studentsBought)>>
<<set $TGA.schoolProsperity to Number($TGA.schoolProsperity)>>
<<set $TFS.studentsBought to Number($TFS.studentsBought)>>
<<set $TFS.schoolProsperity to Number($TFS.schoolProsperity)>>
<<set $arcologies[0].ownership to Number($arcologies[0].ownership)>>
<<set $arcologies[0].minority to Number($arcologies[0].minority)>>
<<set $PC.actualAge to Number($PC.actualAge)>>
<<set $PC.physicalAge = $PC.actualAge, $PC.visualAge = $PC.actualAge>>
The chanting grows louder and louder, CHEAT! CHEAT! CHEAT!
<br><br>
The Arcology morphs and changes shape, CHEAT! CHEAT! CHEAT!
<br><br>
The Arcology has been changed forever and you forfeit your CHEATING CHEATY SOUL!
<</nobr>>\
|
r3d/fc
|
src/cheats/mod_EditArcologyCheatDatatypeCleanup.tw
|
tw
|
bsd-3-clause
| 1,546
|
:: MOD_Edit FS Cheat
<<nobr>>
<<set $nextButton to "Continue">>
<<set $nextLink to "MOD_Edit FS Cheat Datatype Cleanup">>
''Cheating Edit Future Society''
<br>
<<if $arcologies[0].FSSupremacist != "unset" and $arcologies[0].FSSupremacistRace != 0>>
<br>You are ''pursuing'' $arcologies[0].FSSupremacistRace Superiority.
<<else>>
<br>You are ''not pursuing'' Racial Supremacy.
<</if>>
<br>Supremacy (0-100 or unset): <<textbox "$arcologies[0].FSSupremacist" $arcologies[0].FSSupremacist>>
<br>Decoration: $arcologies[0].FSSupremacistDecoration
<br><<radiobutton "$arcologies[0].FSSupremacistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSSupremacistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSSupremacistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSSupremacistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSSupremacistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Universal Enslavement: $arcologies[0].FSSupremacistLawME |
<<radiobutton "$arcologies[0].FSSupremacistLawME" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSSupremacistLawME" 1>> 1 (Passed.)
<br>Supremacist Race:
<<radiobutton "$arcologies[0].FSSupremacistRace" white>> White |
<<radiobutton "$arcologies[0].FSSupremacistRace" asian>> Asian |
<<radiobutton "$arcologies[0].FSSupremacistRace" latina>> Latina |
<<radiobutton "$arcologies[0].FSSupremacistRace" middle eastern>> Middle Eastern |
<<radiobutton "$arcologies[0].FSSupremacistRace" black>> Black |
<<radiobutton "$arcologies[0].FSSupremacistRace" indo-aryan>> Indo-Aryan |
<<radiobutton "$arcologies[0].FSSupremacistRace" amerindian>> Amerindian |
<<radiobutton "$arcologies[0].FSSupremacistRace" pacific islander>> Pacific Islander |
<<radiobutton "$arcologies[0].FSSupremacistRace" southern european>> Southern European |
<<radiobutton "$arcologies[0].FSSupremacistRace" semitic>> Semitic
<br>[[Apply and reset Racial Subjugationism|MOD_Edit FS Cheat][$arcologies[0].FSSubjugationist to "unset", $arcologies[0].FSSubjugationistRace to 0, $arcologies[0].FSSubjugationistDecoration to 20, $arcologies[0].FSSubjugationistLawME to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSSubjugationist != "unset" and $arcologies[0].FSSubjugationistRace != 0>>
<br>''You are pursuing'' $arcologies[0].FSSubjugationistRace Inferiority.
<<else>>
<br>''You are not pursuing'' Racial Subjugationism.
<</if>>
<br>Subjugationism (0-100 or unset): <<textbox "$arcologies[0].FSSubjugationist" $arcologies[0].FSSubjugationist>>
<br>Decoration: $arcologies[0].FSSubjugationistDecoration
<br><<radiobutton "$arcologies[0].FSSubjugationistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSSubjugationistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSSubjugationistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSSubjugationistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSSubjugationistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Universal Enslavement: $arcologies[0].FSSubjugationistLawME |
<<radiobutton "$arcologies[0].FSSubjugationistLawME" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSSubjugationistLawME" 1>> 1 (Passed.)
<br>Subjugationist Race:
<<radiobutton "$arcologies[0].FSSubjugationistRace" white>> White |
<<radiobutton "$arcologies[0].FSSubjugationistRace" asian>> Asian |
<<radiobutton "$arcologies[0].FSSubjugationistRace" latina>> Latina |
<<radiobutton "$arcologies[0].FSSubjugationistRace" middle eastern>> Middle Eastern |
<<radiobutton "$arcologies[0].FSSubjugationistRace" black>> Black |
<<radiobutton "$arcologies[0].FSSubjugationistRace" indo-aryan>> Indo-Aryan |
<<radiobutton "$arcologies[0].FSSubjugationistRace" amerindian>> Amerindian |
<<radiobutton "$arcologies[0].FSSubjugationistRace" pacific islander>> Pacific Islander |
<<radiobutton "$arcologies[0].FSSubjugationistRace" southern european>> Southern European |
<<radiobutton "$arcologies[0].FSSubjugationistRace" semitic>> Semitic
<br>[[Apply and reset Racial Supremacy|MOD_Edit FS Cheat][$arcologies[0].FSSupremacist to "unset",$arcologies[0].FSSupremacistRace to 0, $arcologies[0].FSSupremacistDecoration to 20, $arcologies[0].FSSupremacistLawME to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSGenderRadicalist != "unset">>
<br>You are ''pursuing'' Gender Radicalism.
<<else>>
<br>''You are not pursuing'' Gender Radicalism.
<</if>>
<br>GenderRadicalism (0-100 or unset): <<textbox "$arcologies[0].FSGenderRadicalist" $arcologies[0].FSGenderRadicalist>>
<br>Decoration: $arcologies[0].FSGenderRadicalistDecoration
<br><<radiobutton "$arcologies[0].FSGenderRadicalistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSGenderRadicalistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSGenderRadicalistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSGenderRadicalistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSGenderRadicalistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSGenderRadicalistLaw |
<<radiobutton "$arcologies[0].FSGenderRadicalistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSGenderRadicalistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset Gender Traditionalism|MOD_Edit FS Cheat][$arcologies[0].FSGenderFundamentalist to "unset",$arcologies[0].FSGenderFundamentalistDecoration to 20,$arcologies[0].FSGenderFundamentalistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSGenderFundamentalist != "unset">>
<br>You are ''pursuing'' Gender Traditionalism.
<<else>>
<br>''You are not pursuing'' Gender Traditionalism.
<</if>>
<br>Gender Traditionalism (0-100 or unset): <<textbox "$arcologies[0].FSGenderFundamentalist" $arcologies[0].FSGenderFundamentalist>>
<br>Decoration: $arcologies[0].FSGenderFundamentalistDecoration
<br><<radiobutton "$arcologies[0].FSGenderFundamentalistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSGenderFundamentalistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSGenderFundamentalistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSGenderFundamentalistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSGenderFundamentalistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSGenderFundamentalistSMR |
<<radiobutton "$arcologies[0].FSGenderFundamentalistSMR" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSGenderFundamentalistSMR" 1>> 1 (Passed.)
<br>[[Apply and reset Gender Radicalism|MOD_Edit FS Cheat][$arcologies[0].FSGenderRadicalist to "unset",$arcologies[0].FSGenderRadicalistDecoration to 20,$arcologies[0].FSGenderRadicalistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSRepopulationFocus != "unset">>
<br>You are ''pursuing'' Repopulation Efforts.
<<else>>
<br>''You are not pursuing'' Repopulation Efforts.
<</if>>
<br>Repopulation Efforts (0-100 or unset): <<textbox "$arcologies[0].FSRepopulationFocus" $arcologies[0].FSRepopulationFocus>>
<br>Decoration: $arcologies[0].FSRepopulationFocusDecoration
<br><<radiobutton "$arcologies[0].FSRepopulationFocusDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSRepopulationFocusDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSRepopulationFocusDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSRepopulationFocusDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSRepopulationFocusDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSRepopulationFocusSMR |
<<radiobutton "$arcologies[0].FSRepopulationFocusSMR" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSRepopulationFocusSMR" 1>> 1 (Passed.)
<br>Law: $arcologies[0].FSRepopulationFocusLaw |
<<radiobutton "$arcologies[0].FSRepopulationFocusLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSRepopulationFocusLaw" 1>> 1 (Passed.)
<br>[[Apply and reset Eugenics|MOD_Edit FS Cheat][$arcologies[0].FSRepopulationFocus to "unset",$arcologies[0].FSRepopulationFocusDecoration to 20,$arcologies[0].FSRepopulationFocusLaw to 0, $arcologies[0].FSRepopulationFocusSMR to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSRestart != "unset">>
<br>You are ''pursuing'' Eugenics.
<<else>>
<br>''You are not pursuing'' Eugenics.
<</if>>
<br>Eugenics (0-100 or unset): <<textbox "$arcologies[0].FSRestart" $arcologies[0].FSRestart>>
<br>Decoration: $arcologies[0].FSRestartDecoration
<br><<radiobutton "$arcologies[0].FSRestartDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSRestartDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSRestartDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSRestartDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSRestartDecoration" 100>> 100 (Remodeled exterior; Fully customized; Elite established.)
<br>Law: $arcologies[0].FSRestartSMR |
<<radiobutton "$arcologies[0].FSRestartSMR" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSRestartSMR" 1>> 1 (Passed.)
<br>Law: $arcologies[0].FSRepopulationFocusLaw |
<<radiobutton "$arcologies[0].FSRestartLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSRestartLaw" 1>> 1 (Passed.)
<br>[[Apply and reset Repopulation Efforts|MOD_Edit FS Cheat][$arcologies[0].FSRepopulationFocus to "unset",$arcologies[0].FSRepopulationFocusDecoration to 20,$arcologies[0].FSRestartLaw to 0, $arcologies[0].FSRestartSMR to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSPaternalist != "unset">>
<br>You are ''pursuing'' Paternalism.
<<else>>
<br>''You are not pursuing'' Paternalism.
<</if>>
<br>Paternalism (0-100 or unset): <<textbox "$arcologies[0].FSPaternalist" $arcologies[0].FSPaternalist>>
<br>Decoration: $arcologies[0].FSPaternalistDecoration
<br><<radiobutton "$arcologies[0].FSPaternalistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSPaternalistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSPaternalistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSPaternalistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSPaternalistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSPaternalistLaw |
<<radiobutton "$arcologies[0].FSPaternalistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSPaternalistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset Degradationism|MOD_Edit FS Cheat][$arcologies[0].FSDegradationist to "unset",$arcologies[0].FSDegradationistDecoration to 20,$arcologies[0].FSDegradationistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSDegradationist != "unset">>
<br>You are ''pursuing'' Degradationism.
<<else>>
<br>''You are not pursuing'' Degradationism.
<</if>>
<br>Degradationism (0-100 or unset): <<textbox "$arcologies[0].FSDegradationist" $arcologies[0].FSDegradationist>>
<br>Decoration: $arcologies[0].FSDegradationistDecoration
<br><<radiobutton "$arcologies[0].FSDegradationistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSDegradationistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSDegradationistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSDegradationistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSDegradationistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSDegradationistLaw |
<<radiobutton "$arcologies[0].FSDegradationistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSDegradationistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset Paternalism|MOD_Edit FS Cheat][$arcologies[0].FSPaternalist to "unset",$arcologies[0].FSPaternalistDecoration to 20,$arcologies[0].FSPaternalistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSBodyPurist != "unset">>
<br>You are ''pursuing'' Body Purism.
<<else>>
<br>You are ''not pursuing'' Body Purism.
<</if>>
<br>Body Purism (0-100 or unset): <<textbox "$arcologies[0].FSBodyPurist" $arcologies[0].FSBodyPurist>>
<br>Decoration: $arcologies[0].FSBodyPuristDecoration
<br><<radiobutton "$arcologies[0].FSBodyPuristDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSBodyPuristDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSBodyPuristDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSBodyPuristDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSBodyPuristDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSBodyPuristLaw |
<<radiobutton "$arcologies[0].FSBodyPuristLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSBodyPuristLaw" 1>> 1 (Passed.)
<br>[[Apply and reset Body Transformationism|MOD_Edit FS Cheat][$arcologies[0].FSTransformationFetishist to "unset",$arcologies[0].FSTransformationFetishistDecoration to 20,$arcologies[0].FSTransformationFetishistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSTransformationFetishist != "unset">>
<br>You are ''pursuing'' Body Transformationism.
<<else>>
<br>You are ''not pursuing'' Body Transformationism.
<</if>>
<br>Body Transformationism (0-100 or unset): <<textbox "$arcologies[0].FSTransformationFetishist" $arcologies[0].FSTransformationFetishist>>
<br>Decoration: $arcologies[0].FSTransformationFetishistDecoration
<br><<radiobutton "$arcologies[0].FSTransformationFetishistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSTransformationFetishistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSTransformationFetishistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSTransformationFetishistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSTransformationFetishistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSTransformationFetishistLaw |
<<radiobutton "$arcologies[0].FSTransformationFetishistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSTransformationFetishistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset Body Purism|MOD_Edit FS Cheat][$arcologies[0].FSBodyPurist to "unset",$arcologies[0].FSBodyPuristDecoration to 20,$arcologies[0].FSBodyPuristLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSYouthPreferentialist != "unset">>
<br>You are ''pursuing'' Youth Preferentialism.
<<else>>
<br>You are ''not pursuing'' Youth Preferentialism.
<</if>>
<br>(Setting resets Maturity Preferentialism)
<br>Youth Preferentialism (0-100 or unset): <<textbox "$arcologies[0].FSYouthPreferentialist" $arcologies[0].FSYouthPreferentialist>>
<br>Decoration: $arcologies[0].FSYouthPreferentialistDecoration
<br><<radiobutton "$arcologies[0].FSYouthPreferentialistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSYouthPreferentialistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSYouthPreferentialistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSYouthPreferentialistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSYouthPreferentialistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSYouthPreferentialistLaw |
<<radiobutton "$arcologies[0].FSYouthPreferentialistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSYouthPreferentialistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset Maturity Preferentialism|MOD_Edit FS Cheat][$arcologies[0].FSMaturityPreferentialist to "unset",$arcologies[0].FSMaturityPreferentialistDecoration to 20,$arcologies[0].FSMaturityPreferentialistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSMaturityPreferentialist != "unset">>
<br>You are ''pursuing'' Maturity Preferentialism.
<<else>>
<br>You are ''not pursuing'' Maturity Preferentialism.
<</if>>
<br>(Setting resets Youth Preferentialism)
<br>Maturity Preferentialism (0-100 or unset): <<textbox "$arcologies[0].FSMaturityPreferentialist" $arcologies[0].FSMaturityPreferentialist>>
<br>Decoration: $arcologies[0].FSMaturityPreferentialistDecoration
<br><<radiobutton "$arcologies[0].FSMaturityPreferentialistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSMaturityPreferentialistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSMaturityPreferentialistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSMaturityPreferentialistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSMaturityPreferentialistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSMaturityPreferentialistLaw |
<<radiobutton "$arcologies[0].FSMaturityPreferentialistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSMaturityPreferentialistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset Youth Preferentialism|MOD_Edit FS Cheat][$arcologies[0].FSYouthPreferentialist to "unset",$arcologies[0].FSYouthPreferentialistDecoration to 20,$arcologies[0].FSYouthPreferentialistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSSlimnessEnthusiast != "unset">>
<br>You are ''supporting'' Slimness Enthusiasm.
<<else>>
<br>You are ''not pursuing'' Slimness Enthusiasm.
<</if>>
<br>Slimness Enthusiasm (0-100 or unset): <<textbox "$arcologies[0].FSSlimnessEnthusiast" $arcologies[0].FSSlimnessEnthusiast>>
<br>Decoration: $arcologies[0].FSSlimnessEnthusiastDecoration
<br><<radiobutton "$arcologies[0].FSSlimnessEnthusiastDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSSlimnessEnthusiastDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSSlimnessEnthusiastDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSSlimnessEnthusiastDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSSlimnessEnthusiastDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Market Regulations: $arcologies[0].FSSlimnessEnthusiastSMR |
<<radiobutton "$arcologies[0].FSSlimnessEnthusiastSMR" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSSlimnessEnthusiastSMR" 1>> 1 (Passed.)
<br>[[Apply and reset Asset Expansionism|MOD_Edit FS Cheat][$arcologies[0].FSAssetExpansionist to "unset",$arcologies[0].FSAssetExpansionistDecoration to 20,$arcologies[0].FSAssetExpansionistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSAssetExpansionist != "unset">>
<br>You are ''pursuing'' Asset Expansionism.
<<else>>
<br>You are ''not pursuing'' Asset Expansionism.
<</if>>
<br>(Setting resets Slimness Enthusiasm)
<br>Asset Expansionism (0-100 or unset): <<textbox "$arcologies[0].FSAssetExpansionist" $arcologies[0].FSAssetExpansionist>>
<br>Decoration: $arcologies[0].FSAssetExpansionistDecoration
<br><<radiobutton "$arcologies[0].FSAssetExpansionistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSAssetExpansionistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSAssetExpansionistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSAssetExpansionistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSAssetExpansionistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Market Regulations: $arcologies[0].FSAssetExpansionistSMR |
<<radiobutton "$arcologies[0].FSAssetExpansionistSMR" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSAssetExpansionistSMR" 1>> 1 (Passed.)
<br>[[Apply and reset Slimness Enthusiasm|MOD_Edit FS Cheat][$arcologies[0].FSSlimnessEnthusiast to "unset",$arcologies[0].FSSlimnessEnthusiastDecoration to 20,$arcologies[0].FSSlimnessEnthusiastLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSPastoralist != "unset">>
<br>You are ''pursuing'' Pastoralism.
<<else>>
<br>You are ''not pursuing'' Pastoralism.
<</if>>
<br>Pastoralism (0-100 or unset): <<textbox "$arcologies[0].FSPastoralist" $arcologies[0].FSPastoralist>>
<br>Decoration: $arcologies[0].FSPastoralistDecoration
<br><<radiobutton "$arcologies[0].FSPastoralistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSPastoralistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSPastoralistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSPastoralistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSPastoralistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSPastoralistLaw |
<<radiobutton "$arcologies[0].FSPastoralistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSPastoralistLaw" 1>> 1 (Passed.)
<br>[[Apply|MOD_Edit FS Cheat]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSPhysicalIdealist != "unset">>
<br>You are ''pursuing'' Physical Idealism.
<<else>>
<br>You are ''not pursuing'' Physical Idealism.
<</if>>
<br>Physical Idealism (0-100 or unset): <<textbox "$arcologies[0].FSPhysicalIdealist" $arcologies[0].FSPhysicalIdealist>>
<br>Decoration: $arcologies[0].FSPhysicalIdealistDecoration
<br><<radiobutton "$arcologies[0].FSPhysicalIdealistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSPhysicalIdealistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSPhysicalIdealistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSPhysicalIdealistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSPhysicalIdealistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Market Regulations: $arcologies[0].FSPhysicalIdealistSMR |
<<radiobutton "$arcologies[0].FSPhysicalIdealistSMR" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSPhysicalIdealistSMR" 1>> 1 (Passed.)
<br>[[Apply|MOD_Edit FS Cheat]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSChattelReligionist != "unset">>
<br>You are ''pursuing'' Chattel Religionism.
<<else>>
<br>You are ''not pursuing'' Chattel Religionism.
<</if>>
<br>Chattel Religionism (0-100 or unset): <<textbox "$arcologies[0].FSChattelReligionist" $arcologies[0].FSChattelReligionist>>
<br>Decoration: $arcologies[0].FSChattelReligionistDecoration
<br><<radiobutton "$arcologies[0].FSChattelReligionistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSChattelReligionistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSChattelReligionistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSChattelReligionistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSChattelReligionistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSChattelReligionistLaw |
<<radiobutton "$arcologies[0].FSChattelReligionistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSChattelReligionistLaw" 1>> 1 (Passed.)
<br>[[Apply|MOD_Edit FS Cheat]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSRomanRevivalist != "unset">>
<br>You are ''pursuing'' Roman Revivalism.
<<else>>
<br>You are ''not pursuing'' Roman Revivalism.
<</if>>
<br>Roman Revivalism (0-100 or unset): <<textbox "$arcologies[0].FSRomanRevivalist" $arcologies[0].FSRomanRevivalist>>
<br>Decoration: $arcologies[0].FSRomanRevivalistDecoration
<br><<radiobutton "$arcologies[0].FSRomanRevivalistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSRomanRevivalistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSRomanRevivalistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSRomanRevivalistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSRomanRevivalistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSRomanRevivalistLaw |
<<radiobutton "$arcologies[0].FSRomanRevivalistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSRomanRevivalistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset other Revivalisms|MOD_Edit FS Cheat][$arcologies[0].FSEgyptianRevivalist to "unset",$arcologies[0].FSEgyptianRevivalistDecoration to 20,$arcologies[0].FSEgyptianRevivalistLaw to 0,$arcologies[0].FSEdoRevivalistDecoration to 20,$arcologies[0].FSEdoRevivalistLaw to 0,$arcologies[0].FSArabianRevivalist to "unset",$arcologies[0].FSArabianRevivalistDecoration to 20,$arcologies[0].FSArabianRevivalistLaw to 0,$arcologies[0].FSChineseRevivalist to "unset",$arcologies[0].FSChineseRevivalistDecoration to 20,$arcologies[0].FSChineseRevivalistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSEgyptianRevivalist != "unset">>
<br>You are ''pursuing'' Egyptian Revivalism.
<<else>>
<br>You are ''not pursuing'' Egyptian Revivalism.
<</if>>
<br>Egyptian Revivalism (0-100 or unset): <<textbox "$arcologies[0].FSEgyptianRevivalist" $arcologies[0].FSEgyptianRevivalist>>
<br>Decoration: $arcologies[0].FSEgyptianRevivalistDecoration
<br><<radiobutton "$arcologies[0].FSEgyptianRevivalistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSEgyptianRevivalistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSEgyptianRevivalistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSEgyptianRevivalistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSEgyptianRevivalistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSEgyptianRevivalistLaw |
<<radiobutton "$arcologies[0].FSEgyptianRevivalistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSEgyptianRevivalistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset other Revivalisms|MOD_Edit FS Cheat][$arcologies[0].FSRomanRevivalist to "unset",$arcologies[0].FSRomanRevivalistDecoration to 20,$arcologies[0].FSRomanRevivalistLaw to 0,$arcologies[0].FSEdoRevivalistDecoration to 20,$arcologies[0].FSEdoRevivalistLaw to 0,$arcologies[0].FSArabianRevivalist to "unset",$arcologies[0].FSArabianRevivalistDecoration to 20,$arcologies[0].FSArabianRevivalistLaw to 0,$arcologies[0].FSChineseRevivalist to "unset",$arcologies[0].FSChineseRevivalistDecoration to 20,$arcologies[0].FSChineseRevivalistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSEdoRevivalist != "unset">>
<br>You are ''pursuing'' Edo Revivalism.
<<else>>
<br>You are ''not pursuing'' Edo Revivalism.
<</if>>
<br>Edo Revivalism (0-100 or unset): <<textbox "$arcologies[0].FSEdoRevivalist" $arcologies[0].FSEdoRevivalist>>
<br>Decoration: $arcologies[0].FSEdoRevivalistDecoration
<br><<radiobutton "$arcologies[0].FSEdoRevivalistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSEdoRevivalistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSEdoRevivalistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSEdoRevivalistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSEdoRevivalistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSEdoRevivalistLaw |
<<radiobutton "$arcologies[0].FSEdoRevivalistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSEdoRevivalistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset other Revivalisms|MOD_Edit FS Cheat][$arcologies[0].FSRomanRevivalist to "unset",$arcologies[0].FSRomanRevivalistDecoration to 20,$arcologies[0].FSRomanRevivalistLaw to 0,$arcologies[0].FSEgyptianRevivalistDecoration to 20,$arcologies[0].FSEgyptianRevivalistLaw to 0,$arcologies[0].FSArabianRevivalist to "unset",$arcologies[0].FSArabianRevivalistDecoration to 20,$arcologies[0].FSArabianRevivalistLaw to 0,$arcologies[0].FSChineseRevivalist to "unset",$arcologies[0].FSChineseRevivalistDecoration to 20,$arcologies[0].FSChineseRevivalistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSArabianRevivalist != "unset">>
<br>You are ''pursuing'' Arabian Revivalism.
<<else>>
<br>You are ''not pursuing'' Arabian Revivalism.
<</if>>
<br>Arabian Revivalism (0-100 or unset): <<textbox "$arcologies[0].FSArabianRevivalist" $arcologies[0].FSArabianRevivalist>>
<br>Decoration: $arcologies[0].FSArabianRevivalistDecoration
<br><<radiobutton "$arcologies[0].FSArabianRevivalistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSArabianRevivalistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSArabianRevivalistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSArabianRevivalistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSArabianRevivalistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSArabianRevivalistLaw |
<<radiobutton "$arcologies[0].FSArabianRevivalistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSArabianRevivalistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset other Revivalisms|MOD_Edit FS Cheat][$arcologies[0].FSRomanRevivalist to "unset",$arcologies[0].FSRomanRevivalistDecoration to 20,$arcologies[0].FSRomanRevivalistLaw to 0,$arcologies[0].FSEgyptianRevivalistDecoration to 20,$arcologies[0].FSEgyptianRevivalistLaw to 0,$arcologies[0].FSEdoRevivalist to "unset",$arcologies[0].FSEdoRevivalistDecoration to 20,$arcologies[0].FSEdoRevivalistLaw to 0,$arcologies[0].FSChineseRevivalist to "unset",$arcologies[0].FSChineseRevivalistDecoration to 20,$arcologies[0].FSChineseRevivalistLaw to 0]]
<</nobr>>
<<nobr>>
<<if $arcologies[0].FSChineseRevivalist != "unset">>
<br>You are ''pursuing'' Chinese Revivalism.
<<else>>
<br>You are ''not pursuing'' Chinese Revivalism.
<</if>>
<br>Chinese Revivalism (0-100 or unset): <<textbox "$arcologies[0].FSChineseRevivalist" $arcologies[0].FSChineseRevivalist>>
<br>Decoration: $arcologies[0].FSChineseRevivalistDecoration
<br><<radiobutton "$arcologies[0].FSChineseRevivalistDecoration" 20>> 20 (Minimum)
<br><<radiobutton "$arcologies[0].FSChineseRevivalistDecoration" 40>> 40 (Media support.)
<br><<radiobutton "$arcologies[0].FSChineseRevivalistDecoration" 60>> 60 (Decorated public spaces.)
<br><<radiobutton "$arcologies[0].FSChineseRevivalistDecoration" 80>> 80 (Slaves stationed in public spaces.)
<br><<radiobutton "$arcologies[0].FSChineseRevivalistDecoration" 100>> 100 (Remodeled exterior; Fully customized.)
<br>Law: $arcologies[0].FSChineseRevivalistLaw |
<<radiobutton "$arcologies[0].FSChineseRevivalistLaw" 0>> 0 (Not passed.)
| <<radiobutton "$arcologies[0].FSChineseRevivalistLaw" 1>> 1 (Passed.)
<br>[[Apply and reset other Revivalisms|MOD_Edit FS Cheat][$arcologies[0].FSRomanRevivalist to "unset",$arcologies[0].FSRomanRevivalistDecoration to 20,$arcologies[0].FSRomanRevivalistLaw to 0,$arcologies[0].FSEgyptianRevivalistDecoration to 20,$arcologies[0].FSEgyptianRevivalistLaw to 0,$arcologies[0].FSEdoRevivalist to "unset",$arcologies[0].FSEdoRevivalistDecoration to 20,$arcologies[0].FSEdoRevivalistLaw to 0,$arcologies[0].FSArabianRevivalist to "unset",$arcologies[0].FSArabianRevivalistDecoration to 20,$arcologies[0].FSArabianRevivalistLaw to 0]]
<</nobr>>\
|
r3d/fc
|
src/cheats/mod_EditFSCheat.tw
|
tw
|
bsd-3-clause
| 31,825
|
:: MOD_Edit FS Cheat Datatype Cleanup
<<nobr>>
<<set $nextButton to "Continue">>
<<set $nextLink to "Main">>
<<set $returnTo to "Main">>
<<if $arcologies[0].FSSupremacist != "unset">>
<<set $arcologies[0].FSSupremacist to Number($arcologies[0].FSSupremacist)>>
<<set $arcologies[0].FSSupremacistDecoration to Number($arcologies[0].FSSupremacistDecoration)>>
<<set $arcologies[0].FSSupremacistLawME to Number($arcologies[0].FSSupremacistLawME)>>
<</if>>
<<if $arcologies[0].FSSubjugationist != "unset">>
<<set $arcologies[0].FSSubjugationist to Number($arcologies[0].FSSubjugationist)>>
<<set $arcologies[0].FSSubjugationistDecoration to Number($arcologies[0].FSSubjugationistDecoration)>>
<<set $arcologies[0].FSSubjugationistLawME to Number($arcologies[0].FSSubjugationistLawME)>>
<</if>>
<<if $arcologies[0].FSGenderRadicalist != "unset">>
<<set $arcologies[0].FSGenderRadicalist to Number($arcologies[0].FSGenderRadicalist)>>
<<set $arcologies[0].FSGenderRadicalistDecoration to Number($arcologies[0].FSGenderRadicalistDecoration)>>
<<set $arcologies[0].FSGenderRadicalistLaw to Number($arcologies[0].FSGenderRadicalistLaw)>>
<</if>>
<<if $arcologies[0].FSGenderFundamentalist != "unset">>
<<set $arcologies[0].FSGenderFundamentalist to Number($arcologies[0].FSGenderFundamentalist)>>
<<set $arcologies[0].FSGenderFundamentalistDecoration to Number($arcologies[0].FSGenderFundamentalistDecoration)>>
<<set $arcologies[0].FSGenderFundamentalistLaw to Number($arcologies[0].FSGenderFundamentalistLaw)>>
<<set $arcologies[0].FSGenderFundamentalistSMR to Number($arcologies[0].FSGenderFundamentalistSMR)>>
<</if>>
<<if $arcologies[0].FSPaternalist != "unset">>
<<set $arcologies[0].FSPaternalist to Number($arcologies[0].FSPaternalist)>>
<<set $arcologies[0].FSPaternalistDecoration to Number($arcologies[0].FSPaternalistDecoration)>>
<<set $arcologies[0].FSPaternalistLaw to Number($arcologies[0].FSPaternalistLaw)>>
<</if>>
<<if $arcologies[0].FSDegradationist != "unset">>
<<set $arcologies[0].FSDegradationist to Number($arcologies[0].FSDegradationist)>>
<<set $arcologies[0].FSDegradationistDecoration to Number($arcologies[0].FSDegradationistDecoration)>>
<<set $arcologies[0].FSDegradationistLaw to Number($arcologies[0].FSDegradationistLaw)>>
<</if>>
<<if $arcologies[0].FSBodyPurist != "unset">>
<<set $arcologies[0].FSBodyPurist to Number($arcologies[0].FSBodyPurist)>>
<<set $arcologies[0].FSBodyPuristDecoration to Number($arcologies[0].FSBodyPuristDecoration)>>
<<set $arcologies[0].FSBodyPuristLaw to Number($arcologies[0].FSBodyPuristLaw)>>
<</if>>
<<if $arcologies[0].FSTransformationFetishist != "unset">>
<<set $arcologies[0].FSTransformationFetishist to Number($arcologies[0].FSTransformationFetishist)>>
<<set $arcologies[0].FSTransformationFetishistDecoration to Number($arcologies[0].FSTransformationFetishistDecoration)>>
<<set $arcologies[0].FSTransformationFetishistLaw to Number($arcologies[0].FSTransformationFetishistLaw)>>
<</if>>
<<if $arcologies[0].FSYouthPreferentialist != "unset">>
<<set $arcologies[0].FSYouthPreferentialist to Number($arcologies[0].FSYouthPreferentialist)>>
<<set $arcologies[0].FSYouthPreferentialistDecoration to Number($arcologies[0].FSYouthPreferentialistDecoration)>>
<<set $arcologies[0].FSYouthPreferentialistLaw to Number($arcologies[0].FSYouthPreferentialistLaw)>>
<</if>>
<<if $arcologies[0].FSMaturityPreferentialist != "unset">>
<<set $arcologies[0].FSMaturityPreferentialist to Number($arcologies[0].FSMaturityPreferentialist)>>
<<set $arcologies[0].FSMaturityPreferentialistDecoration to Number($arcologies[0].FSMaturityPreferentialistDecoration)>>
<<set $arcologies[0].FSMaturityPreferentialistLaw to Number($arcologies[0].FSMaturityPreferentialistLaw)>>
<</if>>
<<if $arcologies[0].FSSlimnessEnthusiast != "unset">>
<<set $arcologies[0].FSSlimnessEnthusiast to Number($arcologies[0].FSSlimnessEnthusiast)>>
<<set $arcologies[0].FSSlimnessEnthusiastDecoration to Number($arcologies[0].FSSlimnessEnthusiastDecoration)>>
<<set $arcologies[0].FSSlimnessEnthusiastSMR to Number($arcologies[0].FSSlimnessEnthusiastSMR)>>
<</if>>
<<if $arcologies[0].FSAssetExpansionist != "unset">>
<<set $arcologies[0].FSAssetExpansionist to Number($arcologies[0].FSAssetExpansionist)>>
<<set $arcologies[0].FSAssetExpansionistDecoration to Number($arcologies[0].FSAssetExpansionistDecoration)>>
<<set $arcologies[0].FSAssetExpansionistSMR to Number($arcologies[0].FSAssetExpansionistSMR)>>
<</if>>
<<if $arcologies[0].FSPastoralist != "unset">>
<<set $arcologies[0].FSPastoralist to Number($arcologies[0].FSPastoralist)>>
<<set $arcologies[0].FSPastoralistDecoration to Number($arcologies[0].FSPastoralistDecoration)>>
<<set $arcologies[0].FSPastoralistLaw to Number($arcologies[0].FSPastoralistLaw)>>
<</if>>
<<if $arcologies[0].FSPhysicalIdealist != "unset">>
<<set $arcologies[0].FSPhysicalIdealist to Number($arcologies[0].FSPhysicalIdealist)>>
<<set $arcologies[0].FSPhysicalIdealistDecoration to Number($arcologies[0].FSPhysicalIdealistDecoration)>>
<<set $arcologies[0].FSPhysicalIdealistSMR to Number($arcologies[0].FSPhysicalIdealistSMR)>>
<</if>>
<<if $arcologies[0].FSChattelReligionist != "unset">>
<<set $arcologies[0].FSChattelReligionist to Number($arcologies[0].FSChattelReligionist)>>
<<set $arcologies[0].FSChattelReligionistDecoration to Number($arcologies[0].FSChattelReligionistDecoration)>>
<<set $arcologies[0].FSChattelReligionistLaw to Number($arcologies[0].FSChattelReligionistLaw)>>
<</if>>
<<if $arcologies[0].FSEdoRevivalist != "unset">>
<<set $arcologies[0].FSEdoRevivalist to Number($arcologies[0].FSEdoRevivalist)>>
<<set $arcologies[0].FSEdoRevivalistDecoration to Number($arcologies[0].FSEdoRevivalistDecoration)>>
<<set $arcologies[0].FSEdoRevivalistLaw to Number($arcologies[0].FSEdoRevivalistLaw)>>
<</if>>
<<if $arcologies[0].FSRomanRevivalist != "unset">>
<<set $arcologies[0].FSRomanRevivalist to Number($arcologies[0].FSRomanRevivalist)>>
<<set $arcologies[0].FSRomanRevivalistDecoration to Number($arcologies[0].FSRomanRevivalistDecoration)>>
<<set $arcologies[0].FSRomanRevivalistLaw to Number($arcologies[0].FSRomanRevivalistLaw)>>
<</if>>
<<if $arcologies[0].FSEgyptianRevivalist != "unset">>
<<set $arcologies[0].FSEgyptianRevivalist to Number($arcologies[0].FSEgyptianRevivalist)>>
<<set $arcologies[0].FSEgyptianRevivalistDecoration to Number($arcologies[0].FSEgyptianRevivalistDecoration)>>
<<set $arcologies[0].FSEgyptianRevivalistLaw to Number($arcologies[0].FSEgyptianRevivalistLaw)>>
<</if>>
<<if $arcologies[0].FSEdoRevivalist != "unset">>
<<set $arcologies[0].FSEdoRevivalist to Number($arcologies[0].FSEdoRevivalist)>>
<<set $arcologies[0].FSEdoRevivalistDecoration to Number($arcologies[0].FSEdoRevivalistDecoration)>>
<<set $arcologies[0].FSEdoRevivalistLaw to Number($arcologies[0].FSEdoRevivalistLaw)>>
<</if>>
<<if $arcologies[0].FSArabianRevivalist != "unset">>
<<set $arcologies[0].FSArabianRevivalist to Number($arcologies[0].FSArabianRevivalist)>>
<<set $arcologies[0].FSArabianRevivalistDecoration to Number($arcologies[0].FSArabianRevivalistDecoration)>>
<<set $arcologies[0].FSArabianRevivalistLaw to Number($arcologies[0].FSArabianRevivalistLaw)>>
<</if>>
<<if $arcologies[0].FSChineseRevivalist != "unset">>
<<set $arcologies[0].FSChineseRevivalist to Number($arcologies[0].FSChineseRevivalist)>><<
<<set $arcologies[0].FSChineseRevivalistDecoration to Number($arcologies[0].FSChineseRevivalistDecoration)>>
<<set $arcologies[0].FSChineseRevivalistLaw to Number($arcologies[0].FSChineseRevivalistLaw)>>
<</if>>
You perform the dark rituals, pray to the chaos gods and sold your CHEATING SOUL for the power to change and mold the Future Society to your will.
<br><br>
The Future Society has been changed forever and the chaos gods take YOUR CHEATING SOUL as payment YOU CHEATING CHEATER!
<</nobr>>\
|
r3d/fc
|
src/cheats/mod_EditFSCheatDatatypeCleanup.tw
|
tw
|
bsd-3-clause
| 7,993
|
:: MOD_Edit Slave Cheat [nobr]
<<set $nextButton to "Continue">>
<<set $nextLink to "MOD_Edit Slave Cheat Datatype Cleanup">>
<<set $oldName to $activeSlave.slaveName>>
''Cheating Edit Slave''
<br><br>
''Birth Name:''
<<textbox "$activeSlave.birthName" $activeSlave.birthName>>
<br>''Slave Name (birth name was $activeSlave.birthName):''
<<textbox "$activeSlave.slaveName" $activeSlave.slaveName>>
<br><br>
''Current Slave ID: ($activeSlave.ID)''
<br>
<<if $familyTesting == 1>>
''Enter the IDs for this slaves parents(-2 or 0:random and untracked by system, -1:PC, all others are applicable):''
<br>
''mother ID''
<<textbox "$activeSlave.mother" $activeSlave.mother>>
<br>
''father ID''
<<textbox "$activeSlave.father" $activeSlave.father>>
<<else>>
''Slave Blood Relations (twin, sister, mother, daughter):''
<<textbox "$activeSlave.relation" $activeSlave.relation>>
<br>
''Blood Relations Target ID:''
<<textbox "$activeSlave.relationTarget" $activeSlave.relationTarget>>
<br>
''Relationship (-3:married to you, -2:relationship, -1:emotional slut, 0:none, 1:like, 2:friend, 3:sex friend, 4:lover, 5:married): $activeSlave.relationship |''
<br>
<<radiobutton "$activeSlave.relationship" -3>> Married to You
<<radiobutton "$activeSlave.relationship" -2>> In Relationship with You
<<radiobutton "$activeSlave.relationship" -1>> Emotional Slut
<<radiobutton "$activeSlave.relationship" 0>> None
<<radiobutton "$activeSlave.relationship" 1>> Like
<<radiobutton "$activeSlave.relationship" 2>> Friend
<<radiobutton "$activeSlave.relationship" 3>> Sex Friend
<<radiobutton "$activeSlave.relationship" 4>> Lover
<<radiobutton "$activeSlave.relationship" 5>> Married
<br>
''Relationship Target ID:'' <<textbox "$activeSlave.relationshipTarget" $activeSlave.relationshipTarget>>
<br><br>
<</if>>
<br>
''Career ($activeSlave.career)''
<<textbox "$activeSlave.career" $activeSlave.career>> //Slave variables documentation is your friend. Will tell you exactly what to put here//
<br>
''Origin ($activeSlave.origin)''
<<textbox "$activeSlave.origin" $activeSlave.origin>>
<br>
''Legal status: (-1: slave, 0 or more: indentured for x weeks)''
<<textbox "$activeSlave.indenture" $activeSlave.indenture>>
<br>
''Nationality: ($activeSlave.nationality)''
<<textbox "$activeSlave.nationality" $activeSlave.nationality>>
//This will not alter name or race//
<br>
''Race: ($activeSlave.race)''
<<textbox "$activeSlave.race" $activeSlave.race>>
<br>
<<radiobutton "$activeSlave.race" "white">> White
<<radiobutton "$activeSlave.race" "asian">> Asian
<<radiobutton "$activeSlave.race" "latina">> Latina
<<radiobutton "$activeSlave.race" "middle eastern">> Middle eastern
<<radiobutton "$activeSlave.race" "black">> Black
<<radiobutton "$activeSlave.race" "semitic">> Semitic
<<radiobutton "$activeSlave.race" "southern European">> Southern European
<<radiobutton "$activeSlave.race" "indo-aryan">> Indo-aryan
<<radiobutton "$activeSlave.race" "amerindian">> Amerindian
<<radiobutton "$activeSlave.race" "pacific islander">> Pacific Islander
<<radiobutton "$activeSlave.race" "malay">> Malay
<<radiobutton "$activeSlave.race" "mixed race">> Mixed race
<br>
''Skin color: ($activeSlave.skin)''
<<textbox "$activeSlave.skin" $activeSlave.skin>>
<br>
<<radiobutton "$activeSlave.skin" "white">> White
<<radiobutton "$activeSlave.skin" "fair">> Fair
<<radiobutton "$activeSlave.skin" "tanned">> Tanned
<<radiobutton "$activeSlave.skin" "olive">> Olive
<<radiobutton "$activeSlave.skin" "light brown">> Light brown
<<radiobutton "$activeSlave.skin" "brown">> Brown
<<radiobutton "$activeSlave.skin" "black">> Black
<<radiobutton "$activeSlave.skin" "pale">> Pale
<<radiobutton "$activeSlave.skin" "dark">> Dark
<<radiobutton "$activeSlave.skin" "light">> Light
<<radiobutton "$activeSlave.skin" "extremely pale">> Extremely pale
<br>
''Accent: ($activeSlave.accent)''
<<textbox "$activeSlave.accent" $activeSlave.accent>>
<br>
<<radiobutton "$activeSlave.accent" 0>> None
<<radiobutton "$activeSlave.accent" 1>> Distinctive
<<radiobutton "$activeSlave.accent" 2>> Thick
<<radiobutton "$activeSlave.accent" 3>> Barely Understands Language
<br><br>
''Age - Actual:''
<<textbox "$activeSlave.actualAge" $activeSlave.actualAge>>
<br>
''Age - Physical:''
<<textbox "$activeSlave.physicalAge" $activeSlave.physicalAge>>
<br>
''Age - Visual:''
<<textbox "$activeSlave.visualAge" $activeSlave.visualAge>>
<br>
''Health (-99 to 100, -100 is death):''
<<textbox "$activeSlave.health" $activeSlave.health>>
<br>
''Addiction:''
<<textbox "$activeSlave.addict" $activeSlave.addict>>
<br><br>
//Don't set devotion too far away from old devotion otherwise it won't stick//
<br>
''Devotion (-100 to 100):''
<<textbox "$activeSlave.devotion" $activeSlave.devotion>>
<br>
''Old Devotion (-100 to 100):''
<<textbox "$activeSlave.oldDevotion" $activeSlave.oldDevotion>>
<br>
//Don't set trust too far away from old trust otherwise it won't stick//
<br>
''Trust (-100 to 100):''
<<textbox "$activeSlave.trust" $activeSlave.trust>>
<br>
''Old Trust (-100 to 100):''
<<textbox "$activeSlave.oldTrust" $activeSlave.oldTrust>>
<br><br>
''Her hair is $activeSlave.hStyle''
Custom hair description: <<textbox "$activeSlave.hStyle" $activeSlave.hStyle>>
<br>
//For best results, use a short, uncapitalized and unpunctuated description; for example: 'back in a ponytail'//
<br>
''Hair length: $activeSlave.hLength''
Custom hair length: <<textbox "$activeSlave.hLength" $activeSlave.hLength>>
<br>
''Her hair is $activeSlave.hColor in color''
Custom hair color: <<textbox "$activeSlave.hColor" $activeSlave.hColor>>
<br>
//For best results, use a short, uncapitalized and unpunctuated description; for example: 'black with purple highlights'//
<br>
''Her pubic hair is $activeSlave.pubicHColor in color''
Custom pubic hair color: <<textbox "$activeSlave.pubicHColor" $activeSlave.pubicHColor>>
<br>
''Pubic Hair Style: ($activeSlave.pubicHStyle)''
<<radiobutton "$activeSlave.pubicHStyle" "neat">> Neat
<<radiobutton "$activeSlave.pubicHStyle" "waxed">> Waxed
<<radiobutton "$activeSlave.pubicHStyle" "in a strip">> Strip
<<radiobutton "$activeSlave.pubicHStyle" "bushy">> Bushy
<<radiobutton "$activeSlave.pubicHStyle" "hairless">> Hairless
<br><br>
''Her eyes are $activeSlave.eyeColor in color''
Custom eye color: <<textbox "$activeSlave.eyeColor" $activeSlave.eyeColor>>
<br>
''Her vision is (-1: nearsighted, 1: normal): $activeSlave.eyes''
<br>Eyes: <<textbox "$activeSlave.eyes" $activeSlave.eyes>>
<<radiobutton "$activeSlave.eyes" 1>> Normal
<<radiobutton "$activeSlave.eyes" -1>> Nearsighted
<br><br>
''Change her custom tattoo:'' <<textbox "$activeSlave.customTat" $activeSlave.customTat>>
<br>
//For best results, use complete, capitalized and punctuated sentences; for example: 'She has blue stars tattooed along her cheekbones, and a blue arrow down each arm.'//
<br>
''Change her custom description:'' <<textbox "$activeSlave.customDesc" $activeSlave.customDesc>>
<br>
//For best results, use complete, capitalized and punctuated sentences; for example: 'She has a beauty mark above her left nipple.'//
<br>
''Change her custom label:'' <<textbox "$activeSlave.customLabel" $activeSlave.customLabel>>
<br>
//For best results, use a short phrase; for example: 'Breeder.'//
<br><br>
''Face (-3 to 3): $activeSlave.face |''
<<textbox "$activeSlave.face" $activeSlave.face>>
<br>
<<radiobutton "$activeSlave.face" -3>> Very ugly
<<radiobutton "$activeSlave.face" -2>> Ugly
<<radiobutton "$activeSlave.face" -1>> Unattractive
<<radiobutton "$activeSlave.face" -0>> Pretty
<<radiobutton "$activeSlave.face" 1>> Attractive
<<radiobutton "$activeSlave.face" 2>> Beautiful
<<radiobutton "$activeSlave.face" 3>> Very beautiful
<br>
''Face Shape: $activeSlave.faceShape |''
<<textbox "$activeSlave.faceShape" $activeSlave.faceShape>>
<br>
<<radiobutton "$activeSlave.faceShape" masculine>> Masculine
<<radiobutton "$activeSlave.faceShape" androgynous>> Androgynous
<<radiobutton "$activeSlave.faceShape" normal>> Normal
<<radiobutton "$activeSlave.faceShape" cute>> Cute
<<radiobutton "$activeSlave.faceShape" sensual>> Sensual
<<radiobutton "$activeSlave.faceShape" exotic>> Exotic
<br>
''Face Implant (0 to 2): $activeSlave.faceImplant |''
<<radiobutton "$activeSlave.faceImplant" 0>> None
<<radiobutton "$activeSlave.faceImplant" 1>> Some Work
<<radiobutton "$activeSlave.faceImplant" 2>> Totally Reworked
<br>
''Natural Skin Distinctiveness: $activeSlave.markings |''
<<textbox "$activeSlave.markings" $activeSlave.markings>>
<br>
<<radiobutton "$activeSlave.markings" none>> None
<<radiobutton "$activeSlave.markings" freckles>> Freckles
<<radiobutton "$activeSlave.markings" heavily freckled>> Heavy Freckles
<<radiobutton "$activeSlave.markings" beauty mark>> Beauty Mark
<<radiobutton "$activeSlave.markings" birthmark>> Birth Mark
<br>
''Oral sex (0 to 100):''
<<if $activeSlave.oralSkill <= 10>>
Unskilled.
<<elseif $activeSlave.oralSkill <= 30>>
@@color:cyan;Basic.@@
<<elseif $activeSlave.oralSkill <= 60>>
@@color:cyan;Skilled.@@
<<elseif $activeSlave.oralSkill < 100>>
@@color:cyan;Expert.@@
<<else>>
@@color:cyan;Masterful.@@
<</if>>
<<textbox "$activeSlave.oralSkill" $activeSlave.oralSkill>>
<br>
<<radiobutton "$activeSlave.oralSkill" 0>> Unskilled
<<radiobutton "$activeSlave.oralSkill" 15>> Basic
<<radiobutton "$activeSlave.oralSkill" 35>> Skilled
<<radiobutton "$activeSlave.oralSkill" 65>> Expert
<<radiobutton "$activeSlave.oralSkill" 100>> Masterful
<br>
''Prestige:''
<<textbox "$activeSlave.prestige" $activeSlave.prestige>>
<<radiobutton "$activeSlave.prestige" 0>> 0
<<radiobutton "$activeSlave.prestige" 1>> 1
<<radiobutton "$activeSlave.prestige" 2>> 2
<<radiobutton "$activeSlave.prestige" 3>> 3
<br>
''Prestige description:''
<<textbox "$activeSlave.prestigeDesc" $activeSlave.prestigeDesc>>
<br><br>
''Muscles (0 to 3): $activeSlave.muscles |''
<<textbox "$activeSlave.muscles" $activeSlave.muscles>>
<br>
<<radiobutton "$activeSlave.muscles" 0>> None
<<radiobutton "$activeSlave.muscles" 20>> Tone
<<radiobutton "$activeSlave.muscles" 50>> Muscular
<<radiobutton "$activeSlave.muscles" 100>> Hugely Muscular
<br>
''Height: $activeSlave.height |''
<<textbox "$activeSlave.height" $activeSlave.height>>
<br>
(149 or lower: Petite, 150-159: Short, 160-169: Average, 170-184: Tall, 185 or higher: Very Tall)
<br>
''Height Implant (-1 to 1): $activeSlave.heightImplant |''
<<textbox "$activeSlave.heightImplant" $activeSlave.heightImplant>>
<br>
<<radiobutton "$activeSlave.heightImplant" -1>> Artificially Shortened
<<radiobutton "$activeSlave.heightImplant" 0>> Normal
<<radiobutton "$activeSlave.heightImplant" 1>> Artificially Lengthened
<br><br>
''Lips (0 to 100): $activeSlave.lips |''
<<textbox "$activeSlave.lips" $activeSlave.lips>>
<br>
<<radiobutton "$activeSlave.lips" 0>> Thin
<<radiobutton "$activeSlave.lips" 15>> Normal
<<radiobutton "$activeSlave.lips" 35>> Plush
<<radiobutton "$activeSlave.lips" 65>> Big
<<radiobutton "$activeSlave.lips" 85>> Huge
<<radiobutton "$activeSlave.lips" 100>> Enormous facepussy
<br>
''Lip Implants (0 to 30): $activeSlave.lipsImplant |''
<<radiobutton "$activeSlave.lipsImplant" 0>> None
<<radiobutton "$activeSlave.lipsImplant" 10>> Normal
<<radiobutton "$activeSlave.lipsImplant" 20>> Large
<<radiobutton "$activeSlave.lipsImplant" 30>> Enormous
<br>
''Teeth: $activeSlave.teeth |''
<<textbox "$activeSlave.teeth" $activeSlave.teeth>>
<br>
<<radiobutton "$activeSlave.teeth" normal>> Normal
<<radiobutton "$activeSlave.teeth" pointy>> Pointy
<<radiobutton "$activeSlave.teeth" crooked>> Crooked
<<radiobutton "$activeSlave.teeth" straightening braces>> Straightening Braces
<<radiobutton "$activeSlave.teeth" cosmetic braces>> Cosmetic Braces
<<radiobutton "$activeSlave.teeth" removable>> Removable
<br>
''Voice (0,1,2,3): $activeSlave.voice |''
<<textbox "$activeSlave.voice" $activeSlave.voice>>
<br>
<<radiobutton "$activeSlave.voice" 0>> Mute
<<radiobutton "$activeSlave.voice" 1>> Deep
<<radiobutton "$activeSlave.voice" 2>> Normal
<<radiobutton "$activeSlave.voice" 3>> High
<br><br>
''Weight (-100 to 100):''
<<if $activeSlave.weight < -95>>
@@color:red;Emaciated.@@
<<elseif $activeSlave.weight < -30>>
@@color:red;Skinny.@@
<<elseif $activeSlave.weight < -10>>
Thin.
<<elseif $activeSlave.weight <= 10 >>
Average.
<<elseif $activeSlave.weight <= 30>>
Plush.
<<elseif $activeSlave.weight <= 95>>
@@color:red;Chubby.@@
<<else>>
@@color:red;Fat.@@
<</if>>
<<textbox "$activeSlave.weight" $activeSlave.weight>>
<br>
<<radiobutton "$activeSlave.weight" -100>> Emaciated
<<radiobutton "$activeSlave.weight" -50>> Skinny
<<radiobutton "$activeSlave.weight" -20>> Thin
<<radiobutton "$activeSlave.weight" 0>> Average
<<radiobutton "$activeSlave.weight" 20>> Plush
<<radiobutton "$activeSlave.weight" 50>> Chubby
<<radiobutton "$activeSlave.weight" 100>> Fat
<br>
''Waist (normal:0 | hourglass:1): "$activeSlave.waist" |''
<<textbox "$activeSlave.waist" $activeSlave.waist>>
<br>
<<radiobutton "$activeSlave.waist" 0>> Normal
<<radiobutton "$activeSlave.waist" 1>> Hourglass
<br><br>
''Shoulders (-2 to 2): $activeSlave.shoulders |''
<<radiobutton "$activeSlave.shoulders" -2>> Very narrow
<<radiobutton "$activeSlave.shoulders" -1>> Narrow
<<radiobutton "$activeSlave.shoulders" -0>> Normal
<<radiobutton "$activeSlave.shoulders" 1>> Broad
<<radiobutton "$activeSlave.shoulders" 2>> Very broad
<br>
''Shoulder Surgery (-2 to 2): $activeSlave.shouldersImplant |''
<<radiobutton "$activeSlave.shouldersImplant" -2>> Adv. Narrowed
<<radiobutton "$activeSlave.shouldersImplant" -1>> Narrowed
<<radiobutton "$activeSlave.shouldersImplant" -0>> None
<<radiobutton "$activeSlave.shouldersImplant" 1>> Broadened
<<radiobutton "$activeSlave.shouldersImplant" 2>> Adv. Broadened
<br>
''Hips (-2 to 2): $activeSlave.hips |''
<<radiobutton "$activeSlave.hips" -2>> Very narrow
<<radiobutton "$activeSlave.hips" -1>> Narrow
<<radiobutton "$activeSlave.hips" -0>> Normal
<<radiobutton "$activeSlave.hips" 1>> Broad
<<radiobutton "$activeSlave.hips" 2>> Very broad
<br>
''Hip Surgery(-2 to 2): $activeSlave.hipsImplant |''
<<radiobutton "$activeSlave.hipsImplant" -2>> Adv. Narrowed
<<radiobutton "$activeSlave.hipsImplant" -1>> Narrowed
<<radiobutton "$activeSlave.hipsImplant" -0>> None
<<radiobutton "$activeSlave.hipsImplant" 1>> Broadened
<<radiobutton "$activeSlave.hipsImplant" 2>> Adv. Broadened
<br><br>
''Amputated (0:normal, 1: amputated, -1 to -5 prosthetic limbs):'' $activeSlave.amp
<<textbox "$activeSlave.amp" $activeSlave.amp>>
<br>
<<radiobutton "$activeSlave.amp" 0>> Normal
<<radiobutton "$activeSlave.amp" 1>> Amputated
<<radiobutton "$activeSlave.amp" -1>> Basic prosthetic limbs
<<radiobutton "$activeSlave.amp" -2>> Sexy prosthetic limbs
<<radiobutton "$activeSlave.amp" -3>> Beauty prosthetic limbs
<<radiobutton "$activeSlave.amp" -4>> Combat prosthetic limbs
<<radiobutton "$activeSlave.amp" -5>> Cybernetic limbs
<br><br>
''Breasts (200 to 24000):''
<<textbox "$activeSlave.boobs" $activeSlave.boobs>>
<br>
''Breast Implants:''
<<textbox "$activeSlave.boobsImplant" $activeSlave.boobsImplant>>
<br>
''Breast String Implants (no:0 | yes:1):''
<<textbox "$activeSlave.boobsImplantType" $activeSlave.boobsImplantType>>
<<radiobutton "$activeSlave.boobsImplantType" 0>> No
<<radiobutton "$activeSlave.boobsImplantType" 1>> Yes
<br>
''Lactation (none:0 | natural:1 | artificial:2): $activeSlave.lactation |''
<<textbox "$activeSlave.lactation" $activeSlave.lactation>>
<br>
<<radiobutton "$activeSlave.lactation" 0>> None
<<radiobutton "$activeSlave.lactation" 1>> Natural
<<radiobutton "$activeSlave.lactation" 2>> Artificial
<br><br>
''Breast Shape: $activeSlave.boobShape |''
<<textbox "$activeSlave.boobShape" $activeSlave.boobShape>>
<br>
<<radiobutton "$activeSlave.boobShape" "perky">> perky
<<radiobutton "$activeSlave.boobShape" "torpedo-shaped">> torpedo-shaped
<<radiobutton "$activeSlave.boobShape" "wide-set">> wide-set
<<radiobutton "$activeSlave.boobShape" "downward-facing">> downward-facing
<<radiobutton "$activeSlave.boobShape" "saggy">> saggy
<br>
''Nipples: $activeSlave.nipples |''
<<radiobutton "$activeSlave.nipples" "tiny">> Tiny
<<radiobutton "$activeSlave.nipples" "cute">> Cute
<<radiobutton "$activeSlave.nipples" "puffy">> Puffy
<<radiobutton "$activeSlave.nipples" "inverted">> Inverted
<<radiobutton "$activeSlave.nipples" "huge">> Huge
<br>
''Areolae (Normal:0 to Huge:3): $activeSlave.areolae |''
<<textbox "$activeSlave.areolae" $activeSlave.areolae>>
<br>
<<radiobutton "$activeSlave.areolae" 0>> Normal
<<radiobutton "$activeSlave.areolae" 1>> Large
<<radiobutton "$activeSlave.areolae" 2>> Wide
<<radiobutton "$activeSlave.areolae" 3>> Huge
<br><br>
''Butt Size (1 to 7): ''
<<textbox "$activeSlave.butt" $activeSlave.butt>>
<br>
''Butt Implants (0,1,2,3): $activeSlave.buttImplant'' |
<<radiobutton "$activeSlave.buttImplant" 0>> None
<<radiobutton "$activeSlave.buttImplant" 1>> Normal
<<radiobutton "$activeSlave.buttImplant" 2>> Large
<<radiobutton "$activeSlave.buttImplant" 3>> Huge
<br>
''Butt String Implants (no:0 | yes:1):''
<<textbox "$activeSlave.buttImplantType" $activeSlave.boobsImplantType>>
<<radiobutton "$activeSlave.buttImplantType" 0>> No
<<radiobutton "$activeSlave.buttImplantType" 1>> Yes
<br><br>
''Anus Size:''
<<if $activeSlave.anus == 0>>@@color:lime;Virgin.@@
<<elseif $activeSlave.anus == 1>>Normal.
<<elseif $activeSlave.anus == 2>>Veteran.
<<else>>Gaping.
<</if>>
<br>
<<radiobutton "$activeSlave.anus" 0>> Virgin
<<radiobutton "$activeSlave.anus" 1>> Normal
<<radiobutton "$activeSlave.anus" 2>> Veteran
<<radiobutton "$activeSlave.anus" 3>> Gaping
<br>
''Anal sex (0 to 100):''
<<if $activeSlave.analSkill <= 10>>
Unskilled.
<<elseif $activeSlave.analSkill <= 30>>
@@color:cyan;Basic.@@
<<elseif $activeSlave.analSkill <= 60>>
@@color:cyan;Skilled.@@
<<elseif $activeSlave.analSkill < 100>>
@@color:cyan;Expert.@@
<<else>>
@@color:cyan;Masterful.@@
<</if>>
<<textbox "$activeSlave.analSkill" $activeSlave.analSkill>>
<br>
<<radiobutton "$activeSlave.analSkill" 0>> Unskilled
<<radiobutton "$activeSlave.analSkill" 15>> Basic
<<radiobutton "$activeSlave.analSkill" 35>> Skilled
<<radiobutton "$activeSlave.analSkill" 65>> Expert
<<radiobutton "$activeSlave.analSkill" 100>> Masterful
<br><br>
''Vagina (no vagina:-1,0,1,2,3):''
<<if $activeSlave.vagina is -1>>
//No vagina.//
<<elseif $activeSlave.vagina == 0>>
@@color:lime;Virgin.@@
<<elseif $activeSlave.vagina == 1>>
Normal.
<<elseif $activeSlave.vagina == 2>>
Veteran.
<<else>>
Gaping.
<</if>>
<<textbox "$activeSlave.vagina" $activeSlave.vagina>>
<br>
<<radiobutton "$activeSlave.vagina" -1>> No vagina
<<radiobutton "$activeSlave.vagina" 0>> Virgin
<<radiobutton "$activeSlave.vagina" 1>> Normal
<<radiobutton "$activeSlave.vagina" 2>> Veteran
<<radiobutton "$activeSlave.vagina" 3>> Gaping
<br>
''Vagina Wetness (0,1,2):''
<<if $activeSlave.vaginaLube == 0>>
Dry.
<<elseif $activeSlave.vaginaLube == 1>>
Normal.
<<else>>
Excessive.
<</if>>
<<textbox "$activeSlave.vaginaLube" $activeSlave.vaginaLube>>
<br>
<<radiobutton "$activeSlave.vaginaLube" 0>> Dry
<<radiobutton "$activeSlave.vaginaLube" 1>> Normal
<<radiobutton "$activeSlave.vaginaLube" 2>> Excessive
<br>
''Ovaries (none: 0 | exist: 1): $activeSlave.ovaries''
<<if $activeSlave.ovaries == 1>>
<<checkbox "$activeSlave.ovaries" 0 1 checked>>
<<else>>
<<checkbox "$activeSlave.ovaries" 0 1>>
<</if>>
<br>
''Vaginal sex (0 to 100):''
<<if $activeSlave.vaginalSkill <= 10>>
Unskilled.
<<elseif $activeSlave.vaginalSkill <= 30>>
@@color:cyan;Basic.@@
<<elseif $activeSlave.vaginalSkill <= 60>>
@@color:cyan;Skilled.@@
<<elseif $activeSlave.vaginalSkill < 100>>
@@color:cyan;Expert.@@
<<else>>
@@color:cyan;Masterful.@@
<</if>>
<<textbox "$activeSlave.vaginalSkill" $activeSlave.vaginalSkill>>
<br>
<<radiobutton "$activeSlave.vaginalSkill" 0>> Unskilled
<<radiobutton "$activeSlave.vaginalSkill" 15>> Basic
<<radiobutton "$activeSlave.vaginalSkill" 35>> Skilled
<<radiobutton "$activeSlave.vaginalSkill" 65>> Expert
<<radiobutton "$activeSlave.vaginalSkill" 100>> Masterful
<br>
''Clit:''
<<if $activeSlave.clit == 0>>
Normal. |
<<elseif $activeSlave.clit == 1>>
Big. |
<<elseif $activeSlave.clit == 2>>
Huge. |
<<else>>
Enormous. |
<</if>>
<<radiobutton "$activeSlave.clit" 0>> Normal
<<radiobutton "$activeSlave.clit" 1>> Large
<<radiobutton "$activeSlave.clit" 2>> Huge
<<radiobutton "$activeSlave.clit" 3>> Enormous
<br>
''Labia:''
<<if $activeSlave.labia == 0>>
Minimal. |
<<elseif $activeSlave.labia == 1>>
Normal. |
<<elseif $activeSlave.labia == 2>>
Large. |
<<else>>
Huge. |
<</if>>
<<radiobutton "$activeSlave.labia" 0>> Minimal
<<radiobutton "$activeSlave.labia" 1>> Normal
<<radiobutton "$activeSlave.labia" 2>> Large
<<radiobutton "$activeSlave.labia" 3>> Huge
<br>
''Pregnancy Level (-2: sterile, -1: contraceptives, 0: not pregnant, 1 to 25: pregnant):''
<<if $activeSlave.preg > 20>>
Advanced.
<<elseif $activeSlave.preg > 5>>
Early.
<<elseif $activeSlave.preg == 0>>
None.
<<elseif $activeSlave.preg == -1>>
Using contraceptives.
<<else>>
Sterile.
<</if>>
<<textbox "$activeSlave.preg" $activeSlave.preg>>
<br>
''Number of babies (0: none, 1 - 5):''
<<if $activeSlave.pregType == 1>>
A single baby.
<<elseif $activeSlave.pregType == 2>>
Twins.
<<elseif $activeSlave.pregType == 3>>
Triples.
<<elseif $activeSlave.pregType == 4>>
Quadruplets.
<<elseif $activeSlave.pregType > 4>>
Quintuplets.
<<else>>
None.
<</if>>
<<textbox "$activeSlave.pregType" $activeSlave.pregType>>
<br>
<<radiobutton "$activeSlave.pregType" 0>> None
<<radiobutton "$activeSlave.pregType" 1>> Single
<<radiobutton "$activeSlave.pregType" 2>> Twins
<<radiobutton "$activeSlave.pregType" 3>> Triplets
<<radiobutton "$activeSlave.pregType" 4>> Quadruplets
<<radiobutton "$activeSlave.pregType" 5>> Quintuplets
<br>
''Father (0: none, -1: you, -2: unknown, slave ID):''
<<textbox "$activeSlave.pregSource" $activeSlave.pregSource>>
<br><br>
''Penis (none:0, 1 to 10):''
<<if $activeSlave.dick == 0>>
None.
<<elseif $activeSlave.dick == 1>>
Tiny.
<<elseif $activeSlave.dick == 2>>
Small.
<<elseif $activeSlave.dick == 3>>
Normal.
<<elseif $activeSlave.dick == 4>>
Large.
<<elseif $activeSlave.dick == 5>>
Massive.
<<elseif $activeSlave.dick == 6>>
Huger
<<elseif $activeSlave.dick == 7>>
Still huge.
<<elseif $activeSlave.dick == 8>>
Enormous.
<<else>>
Monstrous.
<</if>>
<<textbox "$activeSlave.dick" $activeSlave.dick>>
<br>
<<radiobutton "$activeSlave.dick" 0>> None
<<radiobutton "$activeSlave.dick" 1>> Tiny
<<radiobutton "$activeSlave.dick" 2>> Small
<<radiobutton "$activeSlave.dick" 3>> Normal
<<radiobutton "$activeSlave.dick" 4>> Large
<<radiobutton "$activeSlave.dick" 5>> Massive
<<radiobutton "$activeSlave.dick" 6>> Huge
<<radiobutton "$activeSlave.dick" 7>> More Huge
<<radiobutton "$activeSlave.dick" 8>> Enormous
<<radiobutton "$activeSlave.dick" 9>> Monstrous
<<radiobutton "$activeSlave.dick" 10>> Big McLargeHuge? I don't know. How many sizes are there?!?!?!
<br>
''Foreskin (0 to 5):''
<<if $activeSlave.foreskin == 0>> None.
<<elseif $activeSlave.foreskin == 1>> Tiny.
<<elseif $activeSlave.foreskin == 2>> Small.
<<elseif $activeSlave.foreskin == 3>> Normal.
<<elseif $activeSlave.foreskin == 4>> Large.
<<else>>Massive.<</if>>
<<textbox "$activeSlave.foreskin" $activeSlave.foreskin>>
<br>
<<radiobutton "$activeSlave.foreskin" 0>> None
<<radiobutton "$activeSlave.foreskin" 1>> Vestigial
<<radiobutton "$activeSlave.foreskin" 2>> Small
<<radiobutton "$activeSlave.foreskin" 3>> Normal
<<radiobutton "$activeSlave.foreskin" 4>> Large
<<radiobutton "$activeSlave.foreskin" 5>> Massive
<br>
''Testicles (0 to 6):''
<<if $activeSlave.balls == 0>>
None.
<<elseif $activeSlave.balls == 1>>
Vestigial.
<<elseif $activeSlave.balls == 2>>
Small.
<<elseif $activeSlave.balls == 3>>
Normal.
<<elseif $activeSlave.balls == 4>>
Large.
<<elseif $activeSlave.balls == 5>>
Huge.
<<else>>
Titanic.
<</if>>
<<textbox "$activeSlave.balls" $activeSlave.balls>>
<br>
<<radiobutton "$activeSlave.balls" 0>> None / Invisible
<<radiobutton "$activeSlave.balls" 1>> Vestigial
<<radiobutton "$activeSlave.balls" 2>> Small
<<radiobutton "$activeSlave.balls" 3>> Normal
<<radiobutton "$activeSlave.balls" 4>> Large
<<radiobutton "$activeSlave.balls" 5>> Huge
<<radiobutton "$activeSlave.balls" 6>> Titanic
<br>
''Ballsack (0 to 8):''
<<if $activeSlave.scrotum == 0>>
None.
<<elseif $activeSlave.scrotum == 1>>
Vestigial.
<<elseif $activeSlave.scrotum == 2>>
Small.
<<elseif $activeSlave.scrotum == 3>>
Normal.
<<elseif $activeSlave.scrotum == 4>>
Large.
<<elseif $activeSlave.scrotum == 5>>
Huge.
<<elseif $activeSlave.scrotum == 6>>
Massive.
<<elseif $activeSlave.scrotum == 7>>
Enormous.
<<else>>
Monstrous.
<</if>>
<<textbox "$activeSlave.scrotum" $activeSlave.scrotum>>
<br>
<<radiobutton "$activeSlave.scrotum" 0>> None
<<radiobutton "$activeSlave.scrotum" 1>> Vestigial
<<radiobutton "$activeSlave.scrotum" 2>> Small
<<radiobutton "$activeSlave.scrotum" 3>> Normal
<<radiobutton "$activeSlave.scrotum" 4>> Large
<<radiobutton "$activeSlave.scrotum" 5>> Huge
<<radiobutton "$activeSlave.scrotum" 6>> Massive
<<radiobutton "$activeSlave.scrotum" 7>> Enormous
<<radiobutton "$activeSlave.scrotum" 8>> Monstrous
<br><br>
''Prostitution (0 to 100):''
<<if $activeSlave.whoreSkill <= 10>>
Unskilled.
<<elseif $activeSlave.whoreSkill <= 30>>
@@color:cyan;Basic.@@
<<elseif $activeSlave.whoreSkill <= 60>>
@@color:cyan;Skilled.@@
<<elseif $activeSlave.whoreSkill < 100>>
@@color:cyan;Expert.@@
<<else>>
@@color:cyan;Masterful.@@
<</if>>
<<textbox "$activeSlave.whoreSkill" $activeSlave.whoreSkill>>
<br>
<<radiobutton "$activeSlave.whoreSkill" 0>> Unskilled
<<radiobutton "$activeSlave.whoreSkill" 15>> Basic
<<radiobutton "$activeSlave.whoreSkill" 35>> Skilled
<<radiobutton "$activeSlave.whoreSkill" 65>> Expert
<<radiobutton "$activeSlave.whoreSkill" 100>> Masterful
<br>
''Entertainment (0 to 100):''
<<if $activeSlave.entertainSkill <= 10>>
Unskilled.
<<elseif $activeSlave.entertainSkill <= 30>>
@@color:cyan;Basic.@@
<<elseif $activeSlave.entertainSkill <= 60>>
@@color:cyan;Skilled.@@
<<elseif $activeSlave.entertainSkill < 100>>
@@color:cyan;Expert.@@
<<else>>
@@color:cyan;Masterful.@@
<</if>>
<<textbox "$activeSlave.entertainSkill" $activeSlave.entertainSkill>>
<br>
<<radiobutton "$activeSlave.entertainSkill" 0>> Unskilled
<<radiobutton "$activeSlave.entertainSkill" 15>> Basic
<<radiobutton "$activeSlave.entertainSkill" 35>> Skilled
<<radiobutton "$activeSlave.entertainSkill" 65>> Expert
<<radiobutton "$activeSlave.entertainSkill" 100>> Masterful
<br>
''Combat (0,1):''
<<if $activeSlave.combatSkill == 0>>
Unskilled.
<<else>>
@@color:cyan;Skilled.@@
<</if>>
<<radiobutton "$activeSlave.combatSkill" 0>> Unskilled
<<radiobutton "$activeSlave.combatSkill" 1>> Skilled
<br><br>
''Intelligence (-3 to 3):''
<<if $activeSlave.intelligence == 3>>
@@color:deepskyblue;Brilliant.@@
<<elseif $activeSlave.intelligence == 2>>
@@color:deepskyblue;Very Smart.@@
<<elseif $activeSlave.intelligence == 1>>
@@color:deepskyblue;Smart.@@
<<elseif $activeSlave.intelligence == 0>>
Average.
<<elseif $activeSlave.intelligence == -1>>
@@color:orangered;Stupid.@@
<<elseif $activeSlave.intelligence == -2>>
@@color:orangered;Very Stupid.@@
<<else>>
@@color:orangered;Moronic.@@
<</if>>
<<textbox "$activeSlave.intelligence" $activeSlave.intelligence>>
<br>
<<radiobutton "$activeSlave.intelligence" -3>> Moronic
<<radiobutton "$activeSlave.intelligence" -2>> Very Stupid
<<radiobutton "$activeSlave.intelligence" -1>> Stupid
<<radiobutton "$activeSlave.intelligence" 0>> Average
<<radiobutton "$activeSlave.intelligence" 1>> Smart
<<radiobutton "$activeSlave.intelligence" 2>> Very Smart
<<radiobutton "$activeSlave.intelligence" 3>> Brilliant
<br>
''Education (0,1):''
<<if $activeSlave.intelligenceImplant == 1>>
@@color:deepskyblue;Educated.@@
<<else>>
Uneducated.
<</if>>
<<radiobutton "$activeSlave.intelligenceImplant" 0>> Uneducated
<<radiobutton "$activeSlave.intelligenceImplant" 1>> Educated
<br><br>
''Fetish Known (Unknown:0 | Known:1): $activeSlave.fetishKnown |''
<<radiobutton "$activeSlave.fetishKnown" 0>> Unknown
<<radiobutton "$activeSlave.fetishKnown" 1>> Known
<br>
<<if $activeSlave.fetish is "none">>
''Fetish:'' @@color:pink;$activeSlave.fetish.@@
<<else>>
''Fetish:'' @@color:lightcoral;$activeSlave.fetish.@@
<</if>>
<br>
<<radiobutton "$activeSlave.fetish" "none">> None
<<radiobutton "$activeSlave.fetish" "submissive">> Submissive
<<radiobutton "$activeSlave.fetish" "dom">> Dom
<<radiobutton "$activeSlave.fetish" "cumslut">> Cumslut
<<radiobutton "$activeSlave.fetish" "humiliation">> Humiliation
<<radiobutton "$activeSlave.fetish" "buttslut">> Buttslut
<<radiobutton "$activeSlave.fetish" "boobs">> Boobs
<<radiobutton "$activeSlave.fetish" "pregnancy">> Pregnancy
<<radiobutton "$activeSlave.fetish" "sadist">> Sadist
<<radiobutton "$activeSlave.fetish" "masochist">> Masochist
<br>
''Fetish strength (0 to 100):''
<<if $activeSlave.fetishStrength > 95>>
@@color:lightcoral;High.@@
<<elseif $activeSlave.fetishStrength <= 60>>
@@color:pink;Low.@@
<<else>>
@@color:hotpink;Normal.@@
<</if>>
<<textbox "$activeSlave.fetishStrength" $activeSlave.fetishStrength>>
<br>
<<radiobutton "$activeSlave.fetishStrength" 0>> Low
<<radiobutton "$activeSlave.fetishStrength" 70>> Normal
<<radiobutton "$activeSlave.fetishStrength" 100>> High
<br><br>
''Sexuality (unknown:0 | known:1):'' $activeSlave.attrKnown
<<radiobutton "$activeSlave.attrKnown" 0>> Unknown
<<radiobutton "$activeSlave.attrKnown" 1>> Known
<br>
''Male Attraction (0 - 100):''
<<if $activeSlave.attrXY <= 5>>
@@color:red;Disgusted by guys,@@
<<elseif $activeSlave.attrXY <= 15>>
@@color:red;Turned off by guys,@@
<<elseif $activeSlave.attrXY <= 35>>
@@color:red;Not attracted to guys,@@
<<elseif $activeSlave.attrXY <= 65>>
Indifferent to guys,
<<elseif $activeSlave.attrXY <= 85>>
@@color:green;Attracted to guys,@@
<<elseif $activeSlave.attrXY <= 95>>
@@color:green;Aroused by guys,@@
<<else>>
@@color:green;Passionate about guys,@@
<</if>>
<<textbox "$activeSlave.attrXY" $activeSlave.attrXY>>
<br>
<<radiobutton "$activeSlave.attrXY" 0>> Disgusted by guys
<<radiobutton "$activeSlave.attrXY" 10>> Turned off by guys
<<radiobutton "$activeSlave.attrXY" 20>> Not attracted to guys
<<radiobutton "$activeSlave.attrXY" 50>> Indifferent to guys
<<radiobutton "$activeSlave.attrXY" 80>> Attracted to guys
<<radiobutton "$activeSlave.attrXY" 90>> Aroused by guys
<<radiobutton "$activeSlave.attrXY" 100>> Passionate about guys
<br>
''Female Attraction (0 - 100):''
<<if $activeSlave.attrXX <= 5>>
@@color:red;disgusted by girls.@@
<<elseif $activeSlave.attrXX <= 15>>
@@color:red;turned off by girls.@@
<<elseif $activeSlave.attrXX <= 35>>
@@color:red;not attracted to girls.@@
<<elseif $activeSlave.attrXX <= 65>>
indifferent to girls.
<<elseif $activeSlave.attrXX <= 85>>
@@color:green;attracted to girls.@@
<<elseif $activeSlave.attrXX <= 95>>
@@color:green;aroused by girls.@@
<<else>>
@@color:green;passionate about girls.@@
<</if>>
<<textbox "$activeSlave.attrXX" $activeSlave.attrXX>>
<br>
<<radiobutton "$activeSlave.attrXX" 0>> Disgusted by girls
<<radiobutton "$activeSlave.attrXX" 10>> Turned off by girls
<<radiobutton "$activeSlave.attrXX" 20>> Not attracted to girls
<<radiobutton "$activeSlave.attrXX" 50>> Indifferent to girls
<<radiobutton "$activeSlave.attrXX" 80>> Attracted to girls
<<radiobutton "$activeSlave.attrXX" 90>> Aroused by girls
<<radiobutton "$activeSlave.attrXX" 100>> Passionate about girls
<br>
''Sex drive (0 - 100):''
<<if $activeSlave.energy == 100>>
@@color:green;Nympho!@@
<<elseif $activeSlave.energy > 80>>
@@color:green;Sex addict.@@
<<elseif $activeSlave.energy > 60>>
@@color:green;Powerful.@@
<<elseif $activeSlave.energy > 40>>
@@color:yellow;Average.@@
<<elseif $activeSlave.energy > 20>>
@@color:red;Poor.@@
<<else>>
@@color:red;Frigid.@@
<</if>>
<<textbox "$activeSlave.energy" $activeSlave.energy>>
<br><br>
''Behavioral Flaw:''
<<if $activeSlave.behavioralFlaw is "none">>
//$activeSlave.behavioralFlaw.//
<<else>>
@@color:red;$activeSlave.behavioralFlaw.@@
<</if>>
<br>
<<radiobutton "$activeSlave.behavioralFlaw" "none">> None
<<radiobutton "$activeSlave.behavioralFlaw" "arrogant">> Arrogant
<<radiobutton "$activeSlave.behavioralFlaw" "bitchy">> Bitchy
<<radiobutton "$activeSlave.behavioralFlaw" "odd">> Odd
<<radiobutton "$activeSlave.behavioralFlaw" "hates men">> Men
<<radiobutton "$activeSlave.behavioralFlaw" "hates women">> Women
<<radiobutton "$activeSlave.behavioralFlaw" "anorexic">> Anorexic
<<radiobutton "$activeSlave.behavioralFlaw" "gluttonous">> Gluttonous
<<radiobutton "$activeSlave.behavioralFlaw" "devout">> Devout
<<radiobutton "$activeSlave.behavioralFlaw" "liberated">> Liberated
<br><br>
''Behavioral Quirk:''
<<if $activeSlave.behavioralQuirk is "none">>
//$activeSlave.behavioralQuirk.//
<<else>>
@@color:green;$activeSlave.behavioralQuirk.@@
<</if>>
<br>
<<radiobutton "$activeSlave.behavioralQuirk" "none">> None
<<radiobutton "$activeSlave.behavioralQuirk" "confident">> Confident
<<radiobutton "$activeSlave.behavioralQuirk" "cutting">> Cutting
<<radiobutton "$activeSlave.behavioralQuirk" "funny">> Funny
<<radiobutton "$activeSlave.behavioralQuirk" "adores women">> Adores Women
<<radiobutton "$activeSlave.behavioralQuirk" "adores men">> Adores Men
<<radiobutton "$activeSlave.behavioralQuirk" "insecure">> Insecure
<<radiobutton "$activeSlave.behavioralQuirk" "fitness">> Fitness
<<radiobutton "$activeSlave.behavioralQuirk" "sinful">> Sinful
<<radiobutton "$activeSlave.behavioralQuirk" "advocate">> Advocate
<<if $activeSlave.behavioralQuirk neq "none">>
<<set $activeSlave.behavioralFlaw to "none">>
<</if>>
<br><br>
''Sexual Flaw / Paraphilias:''
<<if $activeSlave.sexualFlaw is "none">>
//$activeSlave.sexualFlaw.//
<<else>>
@@color:red;$activeSlave.sexualFlaw.@@
<</if>>
<br>
Flaws:
<<radiobutton "$activeSlave.sexualFlaw" "none">> None
<<radiobutton "$activeSlave.sexualFlaw" "hates oral">> Oral
<<radiobutton "$activeSlave.sexualFlaw" "hates anal">> Anal
<<radiobutton "$activeSlave.sexualFlaw" "hates penetration">> Penetration
<<radiobutton "$activeSlave.sexualFlaw" "repressed">> Repressed
<<radiobutton "$activeSlave.sexualFlaw" "shamefast">> Shamefast
<<radiobutton "$activeSlave.sexualFlaw" "apathetic">> Apathetic
<<radiobutton "$activeSlave.sexualFlaw" "idealistic">> Sexually Idealistic
<<radiobutton "$activeSlave.sexualFlaw" "crude">> Crude
<<radiobutton "$activeSlave.sexualFlaw" "judgemental">> Judgemental
<br>
Paraphilias:
<<radiobutton "$activeSlave.sexualFlaw" "cum addict">> Cum addict
<<radiobutton "$activeSlave.sexualFlaw" "anal addict">> Anal addict
<<radiobutton "$activeSlave.sexualFlaw" "attention whore">> Attention whore
<<radiobutton "$activeSlave.sexualFlaw" "breast growth">> Breast obsession
<<radiobutton "$activeSlave.sexualFlaw" "abusive">> Abusive
<<radiobutton "$activeSlave.sexualFlaw" "malicious">> Malicious
<<radiobutton "$activeSlave.sexualFlaw" "self hating">> Self hatred
<<radiobutton "$activeSlave.sexualFlaw" "neglectful">> Self neglect
<<radiobutton "$activeSlave.sexualFlaw" "breeder">> Breeding obsession
<br><br>
''Sexual Quirk:''
<<if $activeSlave.sexualQuirk is "none">>
//$activeSlave.sexualQuirk.//
<<else>>
@@color:green;$activeSlave.sexualQuirk.@@
<</if>>
<br>
<<radiobutton "$activeSlave.sexualQuirk" "none">> None
<<radiobutton "$activeSlave.sexualQuirk" "gagfuck queen">> Gagfuck Queen
<<radiobutton "$activeSlave.sexualQuirk" "painal queen">> Painal Queen
<<radiobutton "$activeSlave.sexualQuirk" "strugglefuck queen">> Strugglefuck Queen
<<radiobutton "$activeSlave.sexualQuirk" "perverted">> Perverted
<<radiobutton "$activeSlave.sexualQuirk" "tease">> Tease
<<radiobutton "$activeSlave.sexualQuirk" "caring">> Caring
<<radiobutton "$activeSlave.sexualQuirk" "romantic">> Romantic
<<radiobutton "$activeSlave.sexualQuirk" "unflinching">> Unflinching
<<radiobutton "$activeSlave.sexualQuirk" "size queen">> Size Queen
<<if $activeSlave.sexualQuirk neq "none">>
<<set $activeSlave.sexualFlaw to "none">>
<</if>>
<br><br>
''Lips Tattoo ($activeSlave.lipsTat)''
<<textbox "$activeSlave.lipsTat" $activeSlave.lipsTat>>
<br>
''Shoulders Tattoo ($activeSlave.shouldersTat)''
<<textbox "$activeSlave.shouldersTat" $activeSlave.shouldersTat>>
<br>
''Arms Tattoo ($activeSlave.armsTat)''
<<textbox "$activeSlave.armsTat" $activeSlave.armsTat>>
<br>
''Legs Tattoo ($activeSlave.legsTat)''
<<textbox "$activeSlave.legsTat" $activeSlave.legsTat>>
<br>
''Boobs Tattoo ($activeSlave.boobsTat)''
<<textbox "$activeSlave.boobsTat" $activeSlave.boobsTat>>
<br>
''Butt Tattoo ($activeSlave.buttTat)''
<<textbox "$activeSlave.buttTat" $activeSlave.buttTat>>
<br>
''Vagina Tattoo ($activeSlave.vaginaTat)''
<<textbox "$activeSlave.vaginaTat" $activeSlave.vaginaTat>>
<br>
''Anus Tattoo ($activeSlave.anusTat)''
<<textbox "$activeSlave.anusTat" $activeSlave.anusTat>>
<br>
''Tramp Stamp Tattoo ($activeSlave.stampTat)''
<<textbox "$activeSlave.stampTat" $activeSlave.stampTat>>
<br><br>
''Lips piercings (0-2): $activeSlave.lipsPiercing''
|
<<radiobutton "$activeSlave.lipsPiercing" 0>> None
<<radiobutton "$activeSlave.lipsPiercing" 1>> Standard
<<radiobutton "$activeSlave.lipsPiercing" 2>> Heavy
<br>
''Tongue piercings (0-2): $activeSlave.tonguePiercing''
|
<<radiobutton "$activeSlave.tonguePiercing" 0>> None
<<radiobutton "$activeSlave.tonguePiercing" 1>> Standard
<<radiobutton "$activeSlave.tonguePiercing" 2>> Heavy
<br>
''Ear piercings (0-2): $activeSlave.earPiercing''
|
<<radiobutton "$activeSlave.earPiercing" 0>> None
<<radiobutton "$activeSlave.earPiercing" 1>> Standard
<<radiobutton "$activeSlave.earPiercing" 2>> Heavy
<br>
''Nose piercings (0-2): $activeSlave.nosePiercing''
|
<<radiobutton "$activeSlave.nosePiercing" 0>> None
<<radiobutton "$activeSlave.nosePiercing" 1>> Standard
<<radiobutton "$activeSlave.nosePiercing" 2>> Heavy
<br>
''Eyebrow piercings (0-2): $activeSlave.eyebrowPiercing''
|
<<radiobutton "$activeSlave.eyebrowPiercing" 0>> None
<<radiobutton "$activeSlave.eyebrowPiercing" 1>> Standard
<<radiobutton "$activeSlave.eyebrowPiercing" 2>> Heavy
<br>
''Navel piercings (0-2): $activeSlave.navelPiercing''
|
<<radiobutton "$activeSlave.navelPiercing" 0>> None
<<radiobutton "$activeSlave.navelPiercing" 1>> Standard
<<radiobutton "$activeSlave.navelPiercing" 2>> Heavy
<br>
''Corset piercings (0-1): $activeSlave.corsetPiercing''
|
<<radiobutton "$activeSlave.corsetPiercing" 0>> None
<<radiobutton "$activeSlave.corsetPiercing" 1>> Pierced
<br>
''Nipples piercings (0-2): $activeSlave.nipplesPiercing''
|
<<radiobutton "$activeSlave.nipplesPiercing" 0>> None
<<radiobutton "$activeSlave.nipplesPiercing" 1>> Standard
<<radiobutton "$activeSlave.nipplesPiercing" 2>> Heavy
<br>
''Areolae piercings (0-2): $activeSlave.areolaePiercing''
|
<<radiobutton "$activeSlave.areolaePiercing" 0>> None
<<radiobutton "$activeSlave.areolaePiercing" 1>> Standard
<<radiobutton "$activeSlave.areolaePiercing" 2>> Heavy
<br>
''Clit/frenulum piercing (0-3): $activeSlave.clitPiercing''
|
<<radiobutton "$activeSlave.clitPiercing" 0>> None
<<radiobutton "$activeSlave.clitPiercing" 1>> Standard
<<radiobutton "$activeSlave.clitPiercing" 2>> Big
<<radiobutton "$activeSlave.clitPiercing" 3>> Smart piercing
<br>
''Pussylips piercings (0-2): $activeSlave.vaginaPiercing''
|
<<radiobutton "$activeSlave.vaginaPiercing" 0>> None
<<radiobutton "$activeSlave.vaginaPiercing" 1>> Standard
<<radiobutton "$activeSlave.vaginaPiercing" 2>> Heavy
<br>
''Anus piercing (0-2): $activeSlave.anusPiercing''
|
<<radiobutton "$activeSlave.anusPiercing" 0>> None
<<radiobutton "$activeSlave.anusPiercing" 1>> Standard
<<radiobutton "$activeSlave.anusPiercing" 2>> Heavy
<br>
''Shaft piercings (0-2): $activeSlave.dickPiercing''
|
<<radiobutton "$activeSlave.dickPiercing" 0>> None
<<radiobutton "$activeSlave.dickPiercing" 1>> Standard
<<radiobutton "$activeSlave.dickPiercing" 2>> Heavy
|
r3d/fc
|
src/cheats/mod_EditSlaveCheat.tw
|
tw
|
bsd-3-clause
| 40,135
|
:: MOD_Edit Slave Cheat Datatype Cleanup
<<nobr>>
<<set $nextButton to "Continue">>
<<set $nextLink to "Slave Interact">>
<<set $rep to Number($rep)>>
<<set $cash to Number($cash)>>
<<set $week to Number($week)>>
<<if $familyTesting == 1>>
<<set $activeSlave.mother to Number($activeSlave.mother)>>
<<set $activeSlave.father to Number($activeSlave.father)>>
<<else>>
<<set $activeSlave.relationTarget to Number($activeSlave.relationTarget)>>
<<set $activeSlave.relationshipTarget to Number($activeSlave.relationshipTarget)>>
<</if>>
<<set $activeSlave.indenture to Number($activeSlave.indenture)>>
<<set $activeSlave.face to Number($activeSlave.face)>>
<<set $activeSlave.hLength to Number($activeSlave.hLength)>>
<<set $activeSlave.oralSkill to Number($activeSlave.oralSkill)>>
<<set $activeSlave.prestige to Number($activeSlave.prestige)>>
<<set $activeSlave.devotion = Number($activeSlave.devotion)>>
<<set $activeSlave.oldDevotion to Number($activeSlave.oldDevotion)>>
<<set $activeSlave.trust = Number($activeSlave.trust)>>
<<set $activeSlave.oldTrust to Number($activeSlave.oldTrust)>>
<<set $activeSlave.age to Number($activeSlave.age)>>
<<set $activeSlave.actualAge to Number($activeSlave.actualAge)>>
<<set $activeSlave.visualAge to Number($activeSlave.visualAge)>>
<<set $activeSlave.physicalAge to Number($activeSlave.physicalAge)>>
<<set $activeSlave.health = Number($activeSlave.health)>>
<<set $activeSlave.addict to Number($activeSlave.addict)>>
<<set $activeSlave.muscles to Number($activeSlave.muscles)>>
<<set $activeSlave.height to Number($activeSlave.height)>>
<<set $activeSlave.heightImplant to Number($activeSlave.heightImplant)>>
<<set $activeSlave.amp to Number($activeSlave.amp)>>
<<set $activeSlave.lips to Number($activeSlave.lips)>>
<<set $activeSlave.lipsImplant to Number($activeSlave.lipsImplant)>>
<<set $activeSlave.voice to Number($activeSlave.voice)>>
<<set $activeSlave.accent to Number($activeSlave.accent)>>
<<set $activeSlave.weight to Number($activeSlave.weight)>>
<<set $activeSlave.waist to Number($activeSlave.waist)>>
<<set $activeSlave.boobs to Number($activeSlave.boobs)>>
<<set $activeSlave.boobsImplant to Number($activeSlave.boobsImplant)>>
<<set $activeSlave.lactation to Number($activeSlave.lactation)>>
<<set $activeSlave.areolae to Number($activeSlave.areolae)>>
<<set $activeSlave.butt to Number($activeSlave.butt)>>
<<set $activeSlave.buttImplant to Number($activeSlave.buttImplant)>>
<<set $activeSlave.anus to Number($activeSlave.anus)>>
<<set $activeSlave.vagina to Number($activeSlave.vagina)>>
<<set $activeSlave.vaginaLube to Number($activeSlave.vaginaLube)>>
<<set $activeSlave.vaginalSkill to Number($activeSlave.vaginalSkill)>>
<<set $activeSlave.preg to Number($activeSlave.preg)>>
<<set $activeSlave.dick to Number($activeSlave.dick)>>
<<set $activeSlave.balls to Number($activeSlave.balls)>>
<<set $activeSlave.whoreSkill to Number($activeSlave.whoreSkill)>>
<<set $activeSlave.entertainSkill to Number($activeSlave.entertainSkill)>>
<<set $activeSlave.intelligence to Number($activeSlave.intelligence)>>
<<set $activeSlave.fetishStrength to Number($activeSlave.fetishStrength)>>
<<set $activeSlave.attrXY to Number($activeSlave.attrXY)>>
<<set $activeSlave.attrXX to Number($activeSlave.attrXX)>>
<<set $activeSlave.energy to Number($activeSlave.energy)>>
You perform the dark rituals, pray to the dark gods and sold your soul for the power to change and mold slaves to your will.
<br><br>
This slave has been changed forever and you have lost a bit of your soul, YOU CHEATER!
<<for $i to 0; $i < $slaves.length; $i++>>
<<if $activeSlave.ID == $slaves[$i].ID>>
<<set $slaves[$i] to $activeSlave>>
<<break>>
<</if>>
<</for>>
<</nobr>>\
|
r3d/fc
|
src/cheats/mod_EditSlaveCheatDatatypeCleanup.tw
|
tw
|
bsd-3-clause
| 3,776
|
:: Start [nobr]
:: StoryTitle
Free Cities
:: StoryIncludes
|
r3d/fc
|
src/config/start.tw.proto
|
proto
|
bsd-3-clause
| 63
|
:: SugarCube configuration [script]
/* Main SugarCube configuration file. */
/* Change the starting passage from the default 'start' to 'Alpha disclaimer'. */
Config.passages.start = "init";
/* Disable forward/back buttons in panel. */
Config.history.controls = false;
/* Set Autosaves. */
config.saves.autosave = "autosave";
/* Save only one game state. */
Config.history.maxStates = 1;
/* Set to 'true' to enable SugarCube's debug mode.
Note: This is an 'engine level' debug mode, completely separate from the game's debug mode. */
Config.debug = false;
|
r3d/fc
|
src/config/sugarCubeConfig.tw
|
tw
|
bsd-3-clause
| 583
|
:: Economy Intro [nobr]
<<if $PC.career == "arcology owner">>
<<goto "Takeover Target">>
<<else>>
It is the year 2037, and the past 21 years have not been kind. The world is starting to fall apart. The climate is deteriorating, resources are being exhausted, and there are more people to feed every year. Technology is advancing, but not fast enough to save everyone. @@color:orange;Exactly how bad is the situation?@@
<br>
<br>[[Very serious.|Trade Intro][$economy to 1]] //Default difficulty.//
<br>[[Not truly dire. Not yet.|Trade Intro][$economy to 0.5]] //Easy economics.//
<br>[[This is the last dance.|Trade Intro][$economy to 1.5]] //Crushing challenge.//
<br>
<br>[[Skip Intro|Intro Summary]] //This will preclude you from taking over an established arcology.//
<</if>>
|
r3d/fc
|
src/events/intro/economyIntro.tw
|
tw
|
bsd-3-clause
| 784
|
:: Extreme Intro
The early Free Cities were wild places where the writ of law did not run. In some of the most depraved, slaves' bodies, minds and even lives were playthings of the wealthy and powerful. Though modern Free Cities are tremendously varied, a majority of the new communities made a choice about whether extreme practices were a flaw in a lawless society or one of its benefits. @@color:orange;How did most Free Cities react to the excesses of the early days?@@
[[They drew back from them.|Gender Intro][$seeExtreme to 0]] //Extreme content such as amputation and castration will not appear.//
[[They reveled in them.|Gender Intro][$seeExtreme to 1]] //Extreme content will appear.//
[[They reveled in them and were particularly inventive.|Gender Intro][$seeExtreme to 1,$seeHyperPreg to 1]] //Extreme content will appear, including hyper-pregnancy related content//
[[They drew back from them, but remained creative.|Gender Intro][$seeExtreme to 0,$seeHyperPreg to 1]] //Extreme content will not appear, but hyper-pregnancy related content might appear.//
|
r3d/fc
|
src/events/intro/extremeIntro.tw
|
tw
|
bsd-3-clause
| 1,072
|
:: Gender Intro
The Free Cities are sexually libertine places, and sexual slavery is ubiquitous. Some of the early Free Cities upheld or even strengthened traditional gender roles, expecting men to be men and women to be women. Others subscribed to an interesting refinement of those gender roles, considering any sex slave female, regardless of her biology. A small minority even went so far as to strongly favor societal feminization of slaves born male; in these, biologically female slaves were a rare sight. @@color:orange;Which kind of Free City came to predominate?@@
[[Free Cities that were open-minded about who could be a slave girl.|Slave Age Intro][$seeDicks to 25]]
//Default setting. A majority of slaves will be biologically female, and all content will be available.//
[[Free Cities that understood that girls are girls.|Slave Age Intro][$seeDicks to 0]]
//Almost all slaves will be biologically female, restricting some content.//
[[Free Cities that understood that girls are girls with some exceptions.|Slave Age Intro][$makeDicks to 1, $seeDicks to 0]]
//This option will make almost all generated slaves female but allow you to make slaves with dicks initially and allow growing of dicks in the fabricator.//
[[Free Cities that preferred girls with dicks.|Slave Age Intro][$seeDicks to 100]]
//Almost all slaves will be biologically male, restricting some content.//
|
r3d/fc
|
src/events/intro/genderIntro.tw
|
tw
|
bsd-3-clause
| 1,485
|
:: Intro Summary [nobr]
<<set $neighboringArcologies to Math.clamp($neighboringArcologies, 0, 8)>>
<<set $FSCreditCount to Math.clamp($FSCreditCount, 4, 7)>>
<<set $PC.actualAge to Math.clamp($PC.actualAge, 14, 80)>>
<<set $PC.birthWeek to Math.clamp($PC.birthWeek, 0, 51)>>
<<silently>>
FertilityAge($fertilityAge)
<</silently>>
You may review your settings before clicking "Continue" to begin.
<br><br>
<<set $minimumSlaveAge = variableAsNumber($minimumSlaveAge, 18, 3, 18)>>
<<set $retirementAge = Math.clamp($retirementAge, 25, 120)>>
<<set $fertilityAge = variableAsNumber($fertilityAge, 13, 3, 18)>>
<<set $potencyAge = variableAsNumber($potencyAge, 13, 3, 18)>>
<<set $PC.mother = Number($PC.mother)>>
<<set $PC.father = Number($PC.father)>>
__''World Settings''__
<<if ($economy != 1) || ($seeDicks != 50) || ($continent != "North America") || ($internationalTrade != 1) || ($internationalVariety != 1) || ($seeRace != 1) || ($seeNationality != 1) || ($seeExtreme != 0) || ($seeCircumcision != 1) || ($seeAge != 1) || ($plot != 1)>>
//[[restore defaults|Intro Summary][$seeDicks to 50,$economy to 1,$continent to "North America",$internationalTrade to 1,$internationalVariety to 1,$seeRace to 1,$seeNationality to 1,$seeExtreme to 0,$seeCircumcision to 1,$seeAge to 1,$plot to 1]]//
<</if>>
<br>
<<if $economy == 1>>
The world economy is in ''doubtful'' shape.
[[Easier|Intro Summary][$economy to 0.5]] | [[Harder|Intro Summary][$economy to 1.5]]
<<elseif $economy < 1>>
The world economy is still in ''good'' shape.
[[Harder|Intro Summary][$economy to 1]]
<<else>>
The world economy is in ''terrible'' shape.
[[Easier|Intro Summary][$economy to 1]]
<</if>>
<<set $drugsCost = Math.trunc(100*$economy)>>
<<set $rulesCost = Math.trunc(100*$economy)>>
<<set $modCost = Math.trunc(50*$economy)>>
<<set $surgeryCost = Math.trunc(300*$economy)>>
<br>
<<if ndef $customVariety>>
You are using standardized slave trading channels. [[Customize the slave trade|Customize Slave Trade][$customVariety to 1, $customWA = 0]]
<br>
<<if $internationalTrade == 0>>
The slave trade is ''continental,'' so a narrower variety of slaves will be available.
[[Allow intercontinental trade|Intro Summary][$internationalTrade to 1]]
<br>
<<else>>
The slave trade is ''international,'' so a wider variety of slaves will be available.
[[Restrict the trade to continental|Intro Summary][$internationalTrade to 0]]
<br>
<</if>>
<<if $internationalTrade == 1>>
<<if $internationalVariety == 0>>
International slave variety is ''semi-realistic,'' so more populous nations will be more common.
[[Normalized national variety|Intro Summary][$internationalVariety to 1]]
<br>
<<else>>
International slave variety is ''normalized,'' so small nations will appear nearly as much as large ones.
[[Semi-realistic national variety|Intro Summary][$internationalVariety to 0]]
<br>
<</if>>
<</if>>
<<else>>
Current nationality distributions are [[Adjust the slave trade|Customize Slave Trade][$customWA = 0]] | [[Stop customizing|Intro Summary][delete $customVariety]]
<br style="clear:both" /><hr style="margin:0">
<<for _i = 0; _i < $nationalitiescheck.length; _i++>>
<<set _nation to $nationalitiescheck[_i]>>
<<print _nation>> @@color:orange;<<print (($nationalities.count(_nation)/$nationalities.length)*100).toFixed(2)>>%@@
<<if _i < $nationalitiescheck.length-1>> | <</if>>
<</for>>
<br style="clear:both" /><hr style="margin:0">
<</if>>
<<if $seeAge == 1>>
Slaves will ''age naturally.''
[[Disable aging|Intro Summary][$seeAge to 0]] |
[[Semi aging|Intro Summary][$seeAge to 2]]
<<elseif $seeAge == 2>>
Slaves ''will'' celebrate birthdays, but ''not age.''
[[Enable aging fully|Intro Summary][$seeAge to 1]] |
[[Disable aging|Intro Summary][$seeAge to 0]]
<<else>>
Slaves will ''not age,'' and not experience birthdays.
[[Enable aging|Intro Summary][$seeAge to 1]] |
[[Semi aging|Intro Summary][$seeAge to 2]]
<</if>>
//This option cannot be changed during the game//
<br>
<<if $seeRace == 1>>
Ethnicity will ''occasionally'' be mentioned.
[[Disable most mentions of race|Intro Summary][$seeRace to 0]]
<<else>>
Ethnicity will ''almost never'' be mentioned.
[[Enable mentions of race|Intro Summary][$seeRace to 1]]
<</if>>
<br>
<<if $seeNationality == 1>>
Nationality will ''occasionally'' be mentioned.
[[Disable most mentions of nationality|Intro Summary][$seeNationality to 0]]
<<else>>
Nationality will ''almost never'' be mentioned.
[[Enable mentions of nationality|Intro Summary][$seeNationality to 1]]
<</if>>
<br>
<<if $seeHyperPreg == 1>>
Extreme pregnancy content like broodmothers is ''enabled''.
[[Disable|Intro Summary][$seeHyperPreg to 0]]
<<else>>
Extreme pregnancy content like broodmothers is ''disabled''.
[[Enable|Intro Summary][$seeHyperPreg to 1]]
<</if>>
<br>
<<if $seeExtreme == 1>>
Extreme content like amputation is ''enabled''.
[[Disable|Intro Summary][$seeExtreme to 0]]
<<else>>
Extreme content like amputation is ''disabled''.
[[Enable|Intro Summary][$seeExtreme to 1]]
<</if>>
<<if $seeDicks != 0>>
<<if $seeCircumcision == 1>>
Circumcision is ''enabled''.
[[Disable|Intro Summary][$seeCircumcision to 0]]
<<else>>
Circumcision is ''disabled''.
[[Enable|Intro Summary][$seeCircumcision to 1]]
<</if>>
<</if>>
<br>
Interactions between slaves' weight and asset size are
<<if ($weightAffectsAssets != 0)>>
''enabled''. [[Disable|Intro Summary][$weightAffectsAssets to 0]]
<<else>>
''disabled''. [[Enable|Intro Summary][$weightAffectsAssets to 1]]
<</if>>
<<if ($curativeSideEffects != 0)>>
Curative side effects are ''enabled''. [[Disable|Intro Summary][$curativeSideEffects to 0]]
<<else>>
Curative side effects are ''disabled''. [[Enable|Intro Summary][$curativeSideEffects to 1]]
<</if>>
<br>
<<switch $seeDicks>>
<<case 100>>
''All''
<<case 90>>
''Almost all''
<<case 75>>
''Most''
<<case 50>>
''Half''
<<case 25>>
''Some''
<<case 10>>
''A few''
<<default>>
''None''
<</switch>>
of the slave girls will have dicks.
<<if $seeDicks != 0>>[[None|Intro Summary][$seeDicks to 0]]<<else>>None<</if>> (0%)
| <<if $seeDicks != 10>>[[A few|Intro Summary][$seeDicks to 10]]<<else>>A few<</if>> (10%)
| <<if $seeDicks != 25>>[[Some|Intro Summary][$seeDicks to 25]]<<else>>Some<</if>> (25%)
| <<if $seeDicks != 50>>[[Half|Intro Summary][$seeDicks to 50]]<<else>>Half<</if>> (50%)
| <<if $seeDicks != 75>>[[Most|Intro Summary][$seeDicks to 75]]<<else>>Most<</if>> (75%)
| <<if $seeDicks != 90>>[[Almost all|Intro Summary][$seeDicks to 90]]<<else>>Almost all<</if>> (90%)
| <<if $seeDicks != 100>>[[All|Intro Summary][$seeDicks to 100]]<<else>>All<</if>> (100%)
<br>
Do you want to be able to give start girls dicks and make them in the fabricator for select slaves even with slave girls with dicks set to 0%?
<<if $makeDicks != 0>>[[No|Intro Summary][$makeDicks to 0]]<<else>>No<</if>>
| <<if $makeDicks != 1>>[[Yes|Intro Summary][$makeDicks to 1]]<<else>>Yes<</if>>
<br>
<<if $minimumSlaveAge < 3>>
<<set $minimumSlaveAge to 3>>
<<elseif $minimumSlaveAge < 18>>
/% OK %/
<<else>>
/% Either out of range or not a number. %/
<<set $minimumSlaveAge to 18>>
<</if>>
Girls appearing in the game will be no younger than <<textbox "$minimumSlaveAge" $minimumSlaveAge "Intro Summary">>
<br>
<<if $retirementAge <= $minimumSlaveAge>>
<<set $retirementAge to $minimumSlaveAge+1>>
<<elseif $retirementAge <= 120>>
/% OK %/
<<else>>
/% Either out of range or not a number. %/
<<set $retirementAge to 45>>
<</if>>
Initial retirement age will be at <<textbox "$retirementAge" $retirementAge "Intro Summary">> //May cause issues with New Game and initial slaves if set below 45.//
<br>
<<if $pedo_mode == 0>>
Randomly generated slaves will generate normally.
[[Loli mode|Intro Summary][$pedo_mode to 1, $minimumSlaveAge = 5]]
<<else>>
Nearly all randomly generated slaves will be under the age of 18, although custom slaves and slaves related to specific events may be older.
[[Normal mode|Intro Summary][$pedo_mode to 0]]
<</if>>
<br>
<<if $fertilityAge < 3>>
<<set $fertilityAge to 3>>
<<elseif $fertilityAge < 18>>
/% OK %/
<<else>>
/% Either out of range or not a number. %/
<<set $fertilityAge to 18>>
<</if>>
Girls will not be able to become pregnant if their age is under <<textbox "$fertilityAge" $fertilityAge "Intro Summary">>
<br>
<<if $potencyAge < 3>>
<<set $potencyAge to 3>>
<<elseif $potencyAge < 18>>
/% OK %/
<<else>>
/% Either out of range or not a number. %/
<<set $potencyAge to 18>>
<</if>>
Girls will not be able to impregnate others if their age is under <<textbox "$potencyAge" $potencyAge "Intro Summary">>
<br>
<<if $precociousPuberty == 0>>
Girls ''can not'' experience precocious puberty. (Unable to become pregnant or inseminate others younger than normal puberty age - $fertilityAge).
[[Enable precocious puberty|Intro Summary][$precociousPuberty to 1]]
<<else>>
Girls ''can'' experience precocious puberty. (Under certain conditions they can become pregnant or inseminate others younger then normal age - $fertilityAge, though they may also experience delayed puberty).
[[Disable precocious puberty|Intro Summary][$precociousPuberty to 0]]
<</if>>
<br>
<<if $AgePenalty == 0>>
Girls ''will not'' receive job and career penalties due to age.
[[Enable age penalties|Intro Summary][$AgePenalty to 1]]
<<else>>
Girls ''will'' receive job and career penalties due to age.
[[Disable age penalties|Intro Summary][$AgePenalty to 0]]
<</if>>
<br>
<<if $loliGrowth == 1>>
Children ''will not'' grow as they age.
[[Enable Growth|Intro Summary][$loliGrowth to 0]]
<<else>>
Children ''will'' grow as they age.
[[Disable Growth|Intro Summary][$loliGrowth to 1]]
<</if>>
<br>
<<if $familyTesting == 1>>
Slaves ''can'' have extended families instead of just a single relative. //May cause lag.//
[[Disable extended familes|Intro Summary][$familyTesting to 0]]
<<else>>
Slaves ''can not'' have extended families, just a single relative. //Vanilla Mode.//
[[Enable extended families|Intro Summary][$familyTesting to 1]]
<</if>> //Extended family mode must be on for the incubation facility to be enabled.//
<<if $familyTesting == 1>>
<<if $inbreeding == 1>>
Successive breeding ''will'' result in sub-average slaves.
[[Disable inbreeding|Intro Summary][$inbreeding to 0]]
<<else>>
Successive breeding ''will not'' result in sub-average slaves.
[[Enable inbreeding|Intro Summary][$inbreeding to 1]]
<</if>>
<</if>>
<br>
<<if $verboseDescriptions == 1>>
Your master suite ''will'' detail slave changes.
[[Disable|Intro Summary][$verboseDescriptions to 0]]
<<else>>
Your master suite ''will not'' detail slave changes.
[[Enable|Intro Summary][$verboseDescriptions to 1]]
<</if>>
<br>
<<if $newDescriptions == 1>>
Slaves ''will'' have alternate titles.
[[Disable|Intro Summary][$newDescriptions to 0]]
<<else>>
Slaves ''will not'' have alternate titles.
[[Enable|Intro Summary][$newDescriptions to 1]]
<</if>>
/* Accordion 000-250-006 */
<br>
Accordion effects on weekly reports are
<<if $useAccordion == 0>>
@@color:red;DISABLED@@. [[Enable|Intro Summary][$useAccordion to 1]]
<<else>>
@@color:cyan;ENABLED@@. [[Disable|Intro Summary][$useAccordion to 0]]
<</if>>
/* Accordion 000-250-006 */
<br>
<<if $plot == 1>>
Game mode: ''two-handed''. Includes non-erotic events concerning the changing world.
[[Disable non-erotic events|Intro Summary][$plot to 0]]
<<else>>
Game mode: ''one-handed''. No non-erotic events concerning the changing world.
[[Enable non-erotic events|Intro Summary][$plot to 1]]
<</if>>
<br>
/% Begin mod section: toggle whether slaves lisp. %/
<<if $disableLisping>>
Lisping: ''slaves will not lisp''.
[[Enable Lisping|Intro Summary][$disableLisping to 0]]
<<else>>
Lisping: ''slaves with fat lips or heavy oral piercings will lisp''.
[[Disable Lisping|Intro Summary][$disableLisping to 1]]
<</if>>
/% End mod section: toggle whether slaves lisp. %/
<br><br>
__The Free City__
<br>
The Free City features ''$neighboringArcologies'' arcologies in addition to your own.
<<textbox "$neighboringArcologies" $neighboringArcologies "Intro Summary">>
<br>
//Setting this to 0 will disable most content involving the rest of the Free City.//
<<if $targetArcology.type == "New">>
<br>
The Free City is located on ''$terrain'' terrain.
[[Urban|Intro Summary][$terrain to "urban"]] |
[[Rural|Intro Summary][$terrain to "rural"]] |
[[Ravine|Intro Summary][$terrain to "ravine"]] |
[[Marine|Intro Summary][$terrain to "marine"]] |
[[Oceanic|Intro Summary][$terrain to "oceanic"]]
<<if $terrain != "oceanic">>
<br>
The Free City is located in ''$continent''.
[[North America|Intro Summary][$continent to "North America", $language to "English"]] | [[South America|Intro Summary][$continent to "South America", $language to "Spanish"]] | [[Brazil|Intro Summary][$continent to "Brazil", $language to "Portuguese"]] | [[Europe|Intro Summary][$continent to "Europe", $language to "English"]] | [[the Middle East|Intro Summary][$continent to "the Middle East", $language to "Arabic"]] | [[Africa|Intro Summary][$continent to "Africa", $language to "Arabic"]] | [[Asia|Intro Summary][$continent to "Asia", $language to "Chinese"]] | [[Australia|Intro Summary][$continent to "Australia", $language to "English"]] | [[Japan|Intro Summary][$continent to "Japan", $language to "Japanese", $PC.race to "asian", $PC.nationality to "Japanese", $PC.hColor to "black", $PC.eyeColor to "brown"]]
<</if>>
<</if>>
<<if ($targetArcology.type != "RomanRevivalist") && ($targetArcology.type != "EgyptianRevivalist") && ($targetArcology.type != "EdoRevivalist") && ($targetArcology.type != "ArabianRevivalist") && ($targetArcology.type != "ChineseRevivalist")>>
<br>
The lingua franca of your arcology is ''$language''.
<<if $language != "English">>
[[English|Intro Summary][$language to "English"]] |
<<else>>
English |
<</if>>
<<if $language != "Spanish">>
[[Spanish|Intro Summary][$language to "Spanish"]] |
<<else>>
Spanish |
<</if>>
<<if $language != "Arabic">>
[[Arabic|Intro Summary][$language to "Arabic"]] |
<<else>>
Arabic |
<</if>>
<<if $language != "Chinese">>
[[Chinese|Intro Summary][$language to "Chinese"]] |
<<else>>
Chinese |
<</if>>
Custom: <<textbox "$language" $language "Intro Summary">>
<</if>>
<br>
The Free City could develop as many as ''$FSCreditCount'' future societies.
<<textbox "$FSCreditCount" $FSCreditCount "Intro Summary">>
<br>
<<if $FSCreditCount >= 7>>
<<set $FSCreditCountString = "seven">>
<<elseif $FSCreditCount == 6>>
<<set $FSCreditCountString = "six">>
<<elseif $FSCreditCount == 5>>
<<set $FSCreditCountString = "five">>
<<elseif $FSCreditCount <= 4>>
<<set $FSCreditCountString = "four">>
<</if>>
//5 is default, 4 behaves the same as pre-patch 0.9.9.0, max is 7.//
//Make sure to hit enter to confirm.//
//This option cannot be changed during the game//
<br><br>
__Player Character__
<br>
<<if $PC.title > 0>>
Conversational title: ''Master''.
[[Switch to Mistress|Intro Summary][$PC.title to 0]]
<<else>>
Conversational title: ''Mistress''.
[[Switch to Master|Intro Summary][$PC.title to 1]]
<</if>>
| Custom: <<textbox "$PC.customTitle" $PC.customTitle "Intro Summary">>
<br>
/*
<<if def $PC.title.customTitle>>
<<set $PC.customTitleLisp to $PC.customTitle, $PC.customTitleLisp to $PC.customTitleLisp.replace("ss", "th"), $PC.customTitleLisp to $PC.customTitleLisp.replace("S", "Th"), $PC.customTitleLisp to $PC.customTitleLisp.replace("s", "th")>>
<</if>>
*/
Custom Lisped: <<textbox "$PC.customTitleLisp" $PC.customTitleLisp "Intro Summary">>
<br>
//If using a custom title, select Master or Mistress to set the gender of your title.//
//Make sure to replace your "s"s with "th"s to have working lisps in your lisped title.//
<<if $freshPC == 1 || $saveImported == 0>>
<br>
Career: ''$PC.career''.
<<if $PC.career != "arcology owner">>
[[Wealth|Intro Summary][$PC.career to "wealth"]] |
[[Business|Intro Summary][$PC.career to "capitalist"]] |
[[PMC work|Intro Summary][$PC.career to "mercenary"]] |
[[Slaving|Intro Summary][$PC.career to "slaver"]] |
[[Engineering|Intro Summary][$PC.career to "engineer"]] |
[[Medicine|Intro Summary][$PC.career to "medicine"]] |
[[Celebrity|Intro Summary][$PC.career to "celebrity"]] |
[[Escort|Intro Summary][$PC.career to "escort"]] |
[[Servant|Intro Summary][$PC.career to "servant"]] |
[[Gang Leader|Intro Summary][$PC.career to "gang"]]
<</if>>
<br>
Method of acquiring your arcology: ''$PC.rumor''.
[[Wealth|Intro Summary][$PC.rumor to "wealth"]] |
[[Hard work|Intro Summary][$PC.rumor to "diligence"]] |
[[Force|Intro Summary][$PC.rumor to "force"]] |
[[Social engineering|Intro Summary][$PC.rumor to "social engineering"]] |
[[Luck|Intro Summary][$PC.rumor to "luck"]]
<br>
Genitalia:
<<if $PC.dick == 1>>
<<if $PC.vagina == 1>>
''penis and vagina''. Sex scene variations; more difficult reputation maintenance; some unique opportunities, especially with breasts.
[[No penis|Intro Summary][$PC.dick to 0]] | [[No vagina|Intro Summary][$PC.vagina to 0]]
<<else>>
''penis''. Standard sex scenes; easiest reputation maintenance.
[[Switch to vagina|Intro Summary][$PC.dick to 0, $PC.vagina to 1]] | [[Add a vagina|Intro Summary][$PC.vagina to 1]]
<</if>>
<<else>>
''vagina''. Sex scene variations; most difficult reputation maintenance.
[[Switch to penis|Intro Summary][$PC.dick to 1, $PC.vagina to 0, $PC.preg = 0]] | [[Add a penis|Intro Summary][$PC.dick to 1]]
<</if>>
<<if $PC.vagina == 1>>
<br>
<<if $PC.preg == -1>>
Contraceptives: ''on''. Can't get pregnant; slight increase to living expenses.
[[Do not take contraceptives|Intro Summary][$PC.preg = 0]]
<<elseif $PC.preg == 0>>
Contraceptives: ''off''. Can get pregnant; some scene alterations.
[[Take contraceptives|Intro Summary][$PC.preg = -1]] | [[Too late for that|Intro Summary][$PC.preg = 10]]
<<elseif $PC.preg == 10>>
Contraceptives: ''pregnant''. Already pregnant; some scene alterations, more difficult reputation management, larger increase to living expenses.
[[Not pregnant|Intro Summary][$PC.preg = 0]] | [[Heavily pregnant|Intro Summary][$PC.preg = 43]]
<<else>>
Contraceptives: ''heavily pregnant''. About to give birth; some scene alterations, more difficult reputation management, larger increase to living expenses.
[[Not pregnant|Intro Summary][$PC.preg = 0]]
<</if>>
<br>
<<if $PC.pregMood == 1>>
Hormones affect mood: ''caring and motherly''. Sex scene alterations; slaves will trust you more, but may try to take advantage of your mercy.
[[Change to no change|Intro Summary][$PC.pregMood = 0]] | [[Change to aggressive|Intro Summary][$PC.pregMood = 2]]
<<elseif $PC.pregMood == 0>>
Hormones affect mood: ''no change''. Vanilla setting.
[[Change to motherly|Intro Summary][$PC.pregMood = 1]] | [[Change to aggressive|Intro Summary][$PC.pregMood = 2]]
<<else>>
Hormones affect mood: ''aggressive and domineering''. Sex scene alterations; slaves will fear you more, but will become more submissive to you.
[[Change to no change|Intro Summary][$PC.pregMood = 0]] | [[Change to motherly|Intro Summary][$PC.pregMood = 1]]
<</if>>
<</if>>
<br>
<<if $PC.boobs > 0>>
Chest: ''breasts''. Sex scene variations; more difficult reputation maintenance.
[[Remove breasts|Intro Summary][$PC.boobs to 0]]
<<else>>
Chest: ''masculine''. Standard sex scenes; easier reputation maintenance.
[[Add breasts|Intro Summary][$PC.boobs to 1]]
<</if>>
<br>
Age:
<<if $PC.actualAge >= 65>>
''old''.
<<elseif $PC.actualAge >= 50>>
''well into middle age''.
<<elseif $PC.actualAge >= 35>>
''entering middle age''.
<<else>>
''surprisingly young''.
<</if>>
<<textbox "$PC.actualAge" $PC.actualAge "Intro Summary">>
<<set $PC.physicalAge = $PC.actualAge, $PC.visualAge = $PC.actualAge>>
<br>
Birthweek:
<<textbox "$PC.birthWeek" $PC.birthWeek "Intro Summary">>
<br>
<<if $playerAging == 2>>
You will ''age naturally.''
[[Disable aging|Intro Summary][$playerAging to 0]] |
[[Semi aging|Intro Summary][$playerAging to 1]]
<<elseif $playerAging == 1>>
You ''will'' celebrate birthdays, but ''not age.''
[[Enable aging fully|Intro Summary][$playerAging to 2]] |
[[Disable aging|Intro Summary][$playerAging to 0]]
<<else>>
You will ''not age,'' and not experience birthdays.
[[Enable aging|Intro Summary][$playerAging to 2]] |
[[Semi aging|Intro Summary][$playerAging to 1]]
<</if>>
//This option cannot be changed during the game//
<br>
Name your character: <<textbox "$PCName" $PCName "Intro Summary">>
<br>
Nationality: ''$PC.nationality''.<<textbox "$PC.nationality" $PC.nationality "Intro Summary">>//Capitalize it//
<br>
Race: ''$PC.race''.
[[White|Intro Summary][$PC.race to "white"]] |
[[Asian|Intro Summary][$PC.race to "asian"]] |
[[Latina|Intro Summary][$PC.race to "latina"]] |
[[Middle Eastern|Intro Summary][$PC.race to "middle eastern"]] |
[[Black|Intro Summary][$PC.race to "black"]] |
[[Semitic|Intro Summary][$PC.race to "semitic"]] |
[[Southern European|Intro Summary][$PC.race to "southern european"]] |
[[Indo-aryan|Intro Summary][$PC.race to "indo-aryan"]] |
[[Amerindian|Intro Summary][$PC.race to "amerindien"]] |
[[Pacific Islander|Intro Summary][$PC.race to "pacific islander"]] |
[[Malay|Intro Summary][$PC.race to "malay"]] |
[[Mixed Race|Intro Summary][$PC.race to "mixed race"]] |
<<textbox "$PC.race" $PC.race "Intro Summary">>
<br>
Skin: ''$PC.skin''.
[[White|Intro Summary][$PC.skin to "white"]] |
[[Fair|Intro Summary][$PC.skin to "fair"]] |
[[Light|Intro Summary][$PC.skin to "light"]] |
[[Dark|Intro Summary][$PC.skin to "dark"]] |
[[Olive|Intro Summary][$PC.skin to "olive"]] |
[[Black|Intro Summary][$PC.skin to "black"]] |
[[Light Brown|Intro Summary][$PC.skin to "light brown"]] |
[[Brown|Intro Summary][$PC.skin to "brown"]] |
[[Pale|Intro Summary][$PC.skin to "pale"]] |
[[Extremely Pale|Intro Summary][$PC.skin to "extremely pale"]] |
<<textbox "$PC.skin" $PC.skin "Intro Summary">>
<br>
Eye color: ''$PC.eyeColor''.
<<textbox "$PC.eyeColor" $PC.eyeColor "Intro Summary">>
<br>
Hair color: ''$PC.hColor''.
<<textbox "$PC.hColor" $PC.hColor "Intro Summary">>
<br>
Preferred refreshment: <<textbox "$PC.refreshment" $PC.refreshment "Intro Summary">> [[Cigars|Intro Summary][$PC.refreshment to "cigar",$PC.refreshmentType = 0]] | [[Whiskey|Intro Summary][$PC.refreshment to "whiskey",$PC.refreshmentType = 1]]
<br>
Preferred method of consumption: ''<<if $PC.refreshmentType == 0>>Smoked<<elseif $PC.refreshmentType == 1>>Drank<<elseif $PC.refreshmentType == 2>>Eaten<<elseif $PC.refreshmentType == 3>>Snorted<<else>>Injected<</if>>''.
[[Smoked|Intro Summary][$PC.refreshmentType = 0]] | [[Drank|Intro Summary][$PC.refreshmentType = 1]] | [[Eaten|Intro Summary][$PC.refreshmentType = 2]] | [[Snorted|Intro Summary][$PC.refreshmentType = 3]] | [[Injected|Intro Summary][$PC.refreshmentType = 4]]
<br>
<<if $PC.refreshmentType == 0>>//"Smoke" must fit into the following sentence: "I smoked a $PC.refreshment" to fit events properly//<</if>>
/*testtest PC mother and father */
<<if $familyTesting == 1>>
<br><br>
''PC ID'' //Remember this so you can create slaves related to you next//
<br><<print $PC.ID>>
<br><br>
''mother ID''
<<textbox "$PC.mother" $PC.mother "Intro Summary">>
<br>
''father ID''
<<textbox "$PC.father" $PC.father "Intro Summary">>
<</if>>
<<else>>
<br>
Method of acquiring your arcology: ''$PC.rumor''.
<br>
Genitalia:
<<if $PC.dick == 1>>
<<if $PC.vagina == 1>>
''penis and vagina''.
<<else>>
''penis''.
<</if>>
<<else>>
''vagina''.
<</if>>
<<if $PC.vagina == 1>>
<br>
<<if $PC.preg == -1>>
Contraceptives: ''on''. Can't get pregnant; slight increase to living expenses.
[[Do not take contraceptives|Intro Summary][$PC.preg = 0]]
<<elseif $PC.preg == 0>>
Contraceptives: ''off''. Can get pregnant; some scene alterations.
[[Take contraceptives|Intro Summary][$PC.preg = -1]]
<<elseif $PC.preg > 0>>
Contraceptives: ''<<print $PC.preg>>weeks pregnant''
<</if>>
<br>
<<if $PC.pregMood == 1>>
Hormones affect mood: ''caring and motherly''. Sex scene alterations; slaves will trust you more, but may try to take advantage of your mercy.
[[Change to no change|Intro Summary][$PC.pregMood = 0]] | [[Change to aggressive|Intro Summary][$PC.pregMood = 2]]
<<elseif $PC.pregMood == 0>>
Hormones affect mood: ''no change''. Vanilla setting.
[[Change to motherly|Intro Summary][$PC.pregMood = 1]] | [[Change to aggressive|Intro Summary][$PC.pregMood = 2]]
<<else>>
Hormones affect mood: ''aggressive and domineering''. Sex scene alterations; slaves will fear you more, but will become more submissive to you.
[[Change to no change|Intro Summary][$PC.pregMood = 0]] | [[Change to motherly|Intro Summary][$PC.pregMood = 1]]
<</if>>
<<if $PC.births > 0>>
<br>
Number of births: ''$PC.births''
<</if>>
<</if>>
<br>
<<if $PC.boobs > 0>>
Chest:
<<if $PC.boobsBonus == 1>>
''big breasts''.
<<elseif $PC.boobsBonus == 2>>
''huge breasts''.
<<elseif $PC.boobsBonus == 3>>
''cow tits''.
<<else>>
''breasts''.
<</if>>
<<else>>
Chest: ''masculine''.
<</if>>
<br>
Age:
<<if $PC.actualAge >= 65>>
''old''.
<<elseif $PC.actualAge >= 50>>
''well into middle age''.
<<elseif $PC.actualAge >= 35>>
''entering middle age''.
<<else>>
''surprisingly young''.
<</if>>
<<set $PC.physicalAge = $PC.actualAge, $PC.visualAge = $PC.actualAge>>
<br>
<<if $playerAging == 2>>
You will ''age naturally.''
[[Disable aging|Intro Summary][$playerAging to 0]] |
[[Semi aging|Intro Summary][$playerAging to 1]]
<<elseif $playerAging == 1>>
You ''will'' celebrate birthdays, but ''not age.''
[[Enable aging fully|Intro Summary][$playerAging to 2]] |
[[Disable aging|Intro Summary][$playerAging to 0]]
<<else>>
You will ''not age,'' and not experience birthdays.
[[Enable aging|Intro Summary][$playerAging to 2]] |
[[Semi aging|Intro Summary][$playerAging to 1]]
<</if>>
//This option cannot be changed during the game//
<br>
Change your name: <<textbox "$PCName" $PCName "Intro Summary">>
<br>
Nationality: ''$PC.nationality''.
<br>
Race: ''$PC.race''.
<br>
Skin: ''$PC.skin''.
<br>
Eye color: ''$PC.eyeColor''.
<br>
Hair color: ''$PC.hColor''.
<br>
Preferred refreshment: <<textbox "$PC.refreshment" $PC.refreshment "Intro Summary">> [[Cigars|Intro Summary][$PC.refreshment to "cigar",$PC.refreshmentType = 0]] | [[Whiskey|Intro Summary][$PC.refreshment to "whiskey",$PC.refreshmentType = 1]]
<br>
Preferred method of consumption: ''<<if $PC.refreshmentType == 0>>Smoked<<elseif $PC.refreshmentType == 1>>Drank<<elseif $PC.refreshmentType == 2>>Eaten<<elseif $PC.refreshmentType == 3>>Snorted<<else>>Injected<</if>>''.
[[Smoked|Intro Summary][$PC.refreshmentType = 0]] | [[Drank|Intro Summary][$PC.refreshmentType = 1]] | [[Eaten|Intro Summary][$PC.refreshmentType = 2]] | [[Snorted|Intro Summary][$PC.refreshmentType = 3]] | [[Injected|Intro Summary][$PC.refreshmentType = 4]]
<br>
<<if $PC.refreshmentType == 0>>//"Smoke" must fit into the following sentence: "I smoked a $PC.refreshment" to fit events properly//<</if>>
/*testtest PC mother and father */
<<if $familyTesting == 1>>
<br><br>
''PC ID'' //Remember this so you can create slaves related to you next//
<br><<print $PC.ID>>
<br><br>
''mother ID''
<br>
''father ID''
<</if>>
<</if>>
<br><br>
Image display
<<if $seeImages == 1>>
''enabled.'' [[Disable|Intro Summary][$seeImages = 0]]
<br>
<<if $imageChoice == 1>>
''Vector art by NoX'' is selected. [[Switch to rendered imagepack|Intro Summary][$imageChoice = 0]]
<<else>>
''Rendered imagepack by Shokushu'' is selected. [[Switch to vector art|Intro Summary][$imageChoice = 1]]
<br>
Slave summary fetish images
<<if $seeMainFetishes == 1>>
''enabled.'' [[Disable|Intro Summary][$seeMainFetishes = 0]]
<<else>>
''disabled.'' [[Enable|Intro Summary][$seeMainFetishes = 1]]
<</if>>
<</if>>
<br>
Slave images in lists are
<<if $seeSummaryImages == 1>>
''enabled.'' [[Disable|Intro Summary][$seeSummaryImages = 0]]
<<else>>
''disabled.'' [[Enable|Intro Summary][$seeSummaryImages = 1]]
<</if>>
<<else>>
''disabled.'' [[Enable|Intro Summary][$seeImages = 1]] //Requires image resources.//
<</if>>
<br><br>
<<if $SFMODToggle == 1>>
The Security Force Mod is ''enabled.''
[[Disable|Intro Summary][$SFMODToggle to 0]]
<<else>>
The Security Force Mod is ''disabled.''
[[Enable|Intro Summary][$SFMODToggle to 1]]
<</if>>
<br>
// This mod from anon1888 offers a lategame security force, triggered around week 80. It is non-canon where it conflicts with canonical updates to the base game.//
<br><br>
[[Continue|init Nationalities][$girls to 2]]
<br><br>
[[Cheat Start|init Nationalities][$cash += 1000000,$girls to 3,$rep += 10000,$dojo += 1,$cheatMode to 1,$seeDesk to 0, $seeFCNN to 0, $sortSlavesBy to "devotion",$sortSlavesOrder to "descending",$sortSlavesMain to 0,$rulesAssistantMain to 1,$abbreviateDevotion to 1,$abbreviateRules to 1,$abbreviateClothes to 2,$abbreviateHealth to 1,$abbreviateDiet to 1,$abbreviateDrugs to 1,$abbreviateRace to 1,$abbreviateNationality to 1,$abbreviateGenitalia to 1,$abbreviatePhysicals to 1,$abbreviateSkills to 1,$abbreviateMental to 2]] | //Intended for debugging: may have unexpected effects//
/*
<br><br>
[[Aging Test Start|init Nationalities][$cash += 1000000,$girls to 3,$rep += 10000,$cheatMode to 1,$minimumSlaveAge to 3,$loliGrowth to 1,$ageMode to 1]] | //Intended for debugging the buggy slave aging feature: may have unexpected effects//
*/
|
r3d/fc
|
src/events/intro/introSummary.tw
|
tw
|
bsd-3-clause
| 29,756
|
:: Location Intro
As the old countries crumble and technology stagnates, the gap between rich and poor increases. In order to continue living a good life without having their property taken by the mob, many of the wealthy and powerful come together to form 'Free Cities.' These are new cities on undeveloped land, in remote areas, or even afloat, fully free of any allegiance or law. These new cities are built on new ideas, with most buildings designed as futuristic, self-contained 'arcologies.' An arcology and everything in it is usually owned by a single person. And you're determined that you will soon be one of those single people. @@color:orange;In what part of the world is your new arcology going to be located?@@
[[North America|Intro Summary][$continent to "North America", $language to "English"]]
[[South America|Intro Summary][$continent to "South America", $language to "Spanish"]]
[[Brazil|Intro Summary][$continent to "Brazil", $language to "Portuguese"]]
[[Europe|Intro Summary][$continent to "Europe", $language to "German"]]
[[the Middle East|Intro Summary][$continent to "the Middle East", $language to "Arabic"]]
[[Africa|Intro Summary][$continent to "Africa", $language to "Arabic"]]
[[Asia|Intro Summary][$continent to "Asia", $language to "Chinese"]]
[[Australia|Intro Summary][$continent to "Australia", $language to "English"]]
[[Japan|Intro Summary][$continent to "Japan", $language to "Japanese", $PC.race to "asian", $PC.nationality to "Japanese", $PC.hColor to "black", $PC.eyeColor to "brown"]]
//Slaves from countries in the selected continent will appear more frequently.//
|
r3d/fc
|
src/events/intro/locationIntro.tw
|
tw
|
bsd-3-clause
| 1,612
|
:: PC Body Intro [nobr]
Most slaveowners in the Free Cities are male. The preexisting power structures of the old world have mostly migrated to the new, and it can often be very hard to be a free woman in the Free Cities. Some manage to make their way, but in many arcologies, men are the owners, and women are the owned. You'll cut a striking figure as the owner and leader of your arcology, but @@color:orange;what's under your business attire?@@
<<set $PC.actualAge to Math.clamp($PC.actualAge, 14, 80)>>
<br>
Under my suit jacket,
<<if $PC.boobs > 0>>
''feminine breasts.''
[[Remove breasts|PC Body Intro][$PC.boobs to 0]]
<<else>>
''masculine muscles.''
[[Add breasts|PC Body Intro][$PC.boobs to 1]]
<</if>>
<br>
Behind the front of my tailored
<<if $PC.dick == 1>>
<<if $PC.vagina == 1>>
slacks, ''both a penis and a vagina.''
[[Remove the penis|PC Body Intro][$PC.dick to 0]] | [[Remove the vagina|PC Body Intro][$PC.vagina to 0]]
<<else>>
slacks, a ''penis.''
[[Switch to vagina|PC Body Intro][$PC.dick to 0, $PC.vagina to 1]] | [[Add a vagina|PC Body Intro][$PC.vagina to 1]]
<</if>>
<<else>>
skirt, a ''vagina.''
[[Switch to penis|PC Body Intro][$PC.dick to 1, $PC.vagina to 0]] | [[Add a penis|PC Body Intro][$PC.dick to 1]]
<</if>>
<br>
//These options will affect sex scenes. Feminine options will increase difficulty.//
<br><br>
Your slaves will refer to you as
<<if $PC.title > 0>>
''Master.''
[[Switch to Mistress|PC Body Intro][$PC.title to 0]]
<<else>>
''Mistress.''
[[Switch to Master|PC Body Intro][$PC.title to 1]]
<</if>>
<br>
//This option will affect scenes but will not change difficulty.//
<br><br>
@@color:orange;How old are you?@@
<br>
I'm
<<if $PC.actualAge >= 65>>
getting up in years. I've made a legacy for myself, and I'm not done yet.
<<elseif $PC.actualAge >= 50>>
well into middle age. I've made a name for myself, and I've still got it.
<<elseif $PC.actualAge >= 35>>
entering middle age. I'm accomplished, and I retain some youthful vigor.
<<else>>
surprisingly young. I'll need to prove myself, but I've got energy to burn.
<</if>>
My age: ''<<textbox "$PC.actualAge" $PC.actualAge "PC Body Intro">>''
<<set $PC.physicalAge = $PC.actualAge, $PC.visualAge = $PC.actualAge>>
<br>
//Older player characters start with more reputation and maintain reputation somewhat more easily, but have slightly less sexual energy.//
<br><br>
Name your character: <<textbox "$PCName" $PCName "PC Body Intro">>
<br>
//As with all text boxes in FC, press the enter key to commit your changes.//
<br>
Preferred refreshment: <<textbox "$PC.refreshment" $PC.refreshment "PC Body Intro">> [[Cigars|PC Body Intro][$PC.refreshment to "cigar",$PC.refreshmentType = 0]] | [[Whiskey|PC Body Intro][$PC.refreshment to "whiskey",$PC.refreshmentType = 1]]
<br>
Preferred method of consumption: ''<<if $PC.refreshmentType == 0>>Smoked<<elseif $PC.refreshmentType == 1>>Drank<<elseif $PC.refreshmentType == 2>>Eaten<<elseif $PC.refreshmentType == 3>>Snorted<<else>>Injected<</if>>''.
[[Smoked|PC Body Intro][$PC.refreshmentType = 0]] | [[Drank|PC Body Intro][$PC.refreshmentType = 1]] | [[Eaten|PC Body Intro][$PC.refreshmentType = 2]] | [[Snorted|PC Body Intro][$PC.refreshmentType = 3]] | [[Injected|PC Body Intro][$PC.refreshmentType = 4]]
<br>
//Flavor only; no mechanical effect. If entering a custom refreshment, please assign proper usage. <<if $PC.refreshmentType == 0>>"Smoke" must fit into the following sentence: "I smoked a $PC.refreshment" to fit events properly<</if>>//
<br><br>
<<if $PC.vagina == 1>>
[[Confirm player character customization|PC Preg Intro]]
<<else>>
[[Confirm player character customization|PC Appearance Intro]]
<</if>>
<br><br>
<<if $SFMODToggle == 1>>
The Security Force Mod is ''enabled.''
[[Disable|PC Body Intro][$SFMODToggle to 0]]
<<else>>
The Security Force Mod is ''disabled.''
[[Enable|PC Body Intro][$SFMODToggle to 1]]
<</if>>
<br>
// This mod from anon1888 offers a lategame security force, triggered around week 80. It should be considered non-canon if it conflicts with canonical updates to the base game. //
|
r3d/fc
|
src/events/intro/pcBodyIntro.tw
|
tw
|
bsd-3-clause
| 4,226
|
:: PC Experience Intro [nobr]
<<if $PC.career == "arcology owner">>
<<goto "PC Rumor Intro">>
<<else>>
You're a relative unknown in the Free Cities, but it's clear you're already accomplished. The meek and average cannot aspire to acquire arcologies. You've got all the necessary skills to take over an arcology and succeed as its owner, but you should be able to leverage the skills and experience you retain from your past, too. @@color:orange;What career brought you to the Free Cities?@@
<br>
<br>[[Idle wealth|PC Rumor Intro][$PC.career to "wealth"]]
<br> //Start with extra money. Your starting slaves will have two free levels of sex skills available.//
<br>[[Venture capitalism|PC Rumor Intro][$PC.career to "capitalist"]]
<br> //You will be more effective at business pursuits. Your starting slaves will have a free level of prostitution skill available.//
<br>[[Private military work|PC Rumor Intro][$PC.career to "mercenary"]]
<br> //You retain mercenary contacts and security skills. Your starting slaves will have free trust available.//
<br>[[Slaving|PC Rumor Intro][$PC.career to "slaver"]]
<br> //Your slave breaking experience will be useful. Your starting slaves will have free devotion available.//
<br>[[Arcology engineering|PC Rumor Intro][$PC.career to "engineer"]]
<br> //Upgrading the arcology will be cheaper. Also, the arcology will start with basic economic upgrades already installed.//
<br>[[Slave surgery|PC Rumor Intro][$PC.career to "medicine"]]
<br> //Surgery will be cheaper and healthier, and drug upgrades will be cheaper. Your starting slaves will have free implants available.//
<br>[[Minor celebrity|PC Rumor Intro][$PC.career to "celebrity"]]
<br> //Start with extra reputation. Your starting slaves will have a free level of entertainment skill available.//
<br>[[High class escort|PC Rumor Intro][$PC.career to "escort"]]
<br> //As an ex-whore, you will find it hard to maintain reputation. Your starting slaves will have a free level of sex skills available, along with a free level of entertainment and prostitution.//
<br>[[Servant|PC Rumor Intro][$PC.career to "servant"]]
<br> //As an ex-servant, you will find it hard to maintain reputation. You know how to lower your upkeep, but not conduct business. Your starting slaves will have free trust and devotion.//
<br>[[Gang Leader|PC Rumor Intro][$PC.career to "gang"]]
<br> //As a gang leader, you know how to haggle slaves, but you will find reputation quite hard to maintain. Your starting slaves will be fitter and posses a free level of combat skill.//
<</if>>
|
r3d/fc
|
src/events/intro/pcExperienceIntro.tw
|
tw
|
bsd-3-clause
| 2,797
|
:: PC Rumor Intro
Who you are is something that you will have to define for yourself through your actions. Once you own an arcology, no one will be in a position to apply moral scorekeeping to you. In the brave new world of the Free Cities, you will be free to define yourself as the sum of your actions, rather than as the product of your past. The first decision that will define who you are as an arcology owner is your choice of method in acquiring one. @@color:orange;What approach will you take?@@
[[A judicious application of funds|Takeover Target][$PC.rumor to "wealth"]]
//Start with extra money, since you were wealthy enough to buy an arcology.//
[[Hard work and diligence|Takeover Target][$PC.rumor to "diligence"]]
//New slaves will hate you less, since it will be known that you worked hard to earn your position.//
[[The remorseless use of force|Takeover Target][$PC.rumor to "force"]]
//New slaves will fear you more, since rumors about your violent takeover will inevitably circulate.//
[[Clever social engineering|Takeover Target][$PC.rumor to "social engineering"]]
//Start with the first societal option unlocked, since you manipulated the arcology's citizens.//
[[Blind luck|Takeover Target][$PC.rumor to "luck"]]
//Start with a good reputation, since the story of your unlikely accession will be famous.//
|
r3d/fc
|
src/events/intro/pcRumorIntro.tw
|
tw
|
bsd-3-clause
| 1,450
|
:: Terrain Intro [nobr]
<<unset $targetArcologies>>
<<if $targetArcology.type != "New">>
<<set $terrain = $targetArcology.terrain, $continent = $targetArcology.continent>>
<<switch $targetArcology.type>>
<<case "RomanRevivalist">><<set $language = "Latin">>
<<case "EgyptianRevivalist">><<set $language = "Ancient Egyptian">>
<<case "EdoRevivalist">><<set $language = "Japanese">>
<<case "ArabianRevivalist">><<set $language = "Arabic">>
<<case "ChineseRevivalist">><<set $language = "Chinese">>
<<default>>
<<switch $terrain>>
<<case "oceanic" "North America" "Australia">><<set $language = "English">>
<<case "South America">><<set $language = "Spanish">>
<<case "Brazil">><<set $language = "Portuguese">>
<<case "the Middle East" "Africa">><<set $language = "Arabic">>
<<case "Asia">><<set $language = "Chinese">>
<<case "Europe">><<set $language = "German">>
<<case "Japan">><<set $language = "Japanese">>
<</switch>>
<</switch>>
<<goto "Intro Summary">>
<<else>>
The Free Cities are located wherever the rule of law is weak enough or permissive enough to allow a small area to secede, and where founders can afford to buy an area on which to build.
<br><br>
Many Free Cities are therefore located in marginal, rural terrain. Founding a Free City in such an area is easy, and can usually be accomplished with the indifference or even connivance of the old country from which it secedes. After all, the potential commercial benefits are great, and the loss of underused land is only significant in the moral sense.
<br><br>
Some Free Cities are located on water. Though some areas of shallow sea over the continental shelves hide valuable resources, others are neglected. Arcologies are such massive structures that it is very possible to design them to float anchored to the seabed.
<br><br>
Finally, a few Free Cities have been carved out from old world cities. Urban decay has left the hearts of many cities ripe for this. Many old world countries resist this kind of secession, but this rarest, smallest, and densest kind of Free City can offer its surrounding nation a great deal of economic advantage.
<br><br>
@@color:orange;Which kind of Free City hosts your arcology?@@
<br>
<br>[[Urban|Location Intro][$terrain to "urban"]]
<br> @@color:yellow;Low@@ minimum slave value and initial @@color:yellow;bear market@@ for slaves.
<br> @@color:green;High@@ ease of commerce with the old world.
<br> @@color:green;High@@ access to refugees and other desperate people.
<br> @@color:red;Low@@ cultural independence.
<br>[[Rural|Location Intro][$terrain to "rural"]]
<br> @@color:yellow;High@@ minimum slave value and initial @@color:yellow;bull market@@ for slaves.
<br> Moderate ease of commerce with the old world.
<br> Moderate access to refugees and other desperate people.
<br> Moderate cultural independence.
<br>[[Ravine|Location Intro][$terrain to "ravine"]]
<br> @@color:yellow;High@@ minimum slave value and initial @@color:yellow;bull market@@ for slaves.
<br> @@color:red;Low@@ ease of commerce with the old world.
<br> @@color:red;Very low@@ access to refugees and other desperate people.
<br> @@color:green;High@@ cultural independence.
<br>[[Marine|Location Intro][$terrain to "marine"]]
<br> Moderate minimum slave value and initially balanced market for slaves.
<br> Moderate ease of commerce with the old world.
<br> @@color:red;Low@@ access to refugees and other desperate people.
<br> @@color:green;High@@ cultural independence.
<br>[[Oceanic|Intro Summary][$terrain to "oceanic"]]
<br> @@color:yellow;High@@ minimum slave value and initial @@color:yellow;bull market@@ for slaves.
<br> Moderate ease of commerce with the old world.
<br> @@color:red;Very low@@ access to refugees and other desperate people.
<br> @@color:green;Very high@@ cultural independence.
<br> Ensures access to slaves from all over the world and will not associate the arcology with a continent.
<</if>>
|
r3d/fc
|
src/events/intro/terrainIntro.tw
|
tw
|
bsd-3-clause
| 4,415
|
:: Trade Intro [nobr]
Most of the Free Cities are run on radically libertarian or even anarcho-capitalist principles. The first Free Cities experimented with indentured servitude, and this rapidly developed into widespread slavery. By now, the Free Cities collectively are a fundamentally slaveowning society and maintain a thriving slave trade that feeds off the terrible conditions in parts of the old world. @@color:orange;What attitude have the old world countries generally taken towards this trade?@@
<br><br>
[[They've turned a blind eye, or even been complicit.|Extreme Intro][$internationalTrade to 1]] //Slaves from all across the world will appear.//<br>
[[They've done what little they can to stop it.|Extreme Intro][$internationalTrade to 0]] //Almost all slaves will be from the continent where the arcology is located.//<br>
<<link "Reactions have been mixed.">><<set $internationalTrade to 0, $customVariety to 1, $customWA = 1>><<goto "Customize Slave Trade">><</link>> //This will bypass arcology location restrictions, allowing you to adjust the nationalities encountered when buying non-customizable slaves.//<br>
|
r3d/fc
|
src/events/intro/tradeIntro.tw
|
tw
|
bsd-3-clause
| 1,134
|
:: Brothel Assignment Scene
<<nobr>>
<<set $nextButton to "Continue">>
<<set $nextLink to $returnTo>>
You could direct $assistantName to relay your orders to $activeSlave.slaveName, but you've decided to avoid relying too much on machine assistance. So, she is merely directed to report to your office. The
<<if $activeSlave.devotion > 95>>
worshipful girl <<if $activeSlave.amp != 1>>hurries in as soon as she possibly can<<else>>comes in as soon as she can get another slave to carry her in<</if>>, happy her beloved <<if $PC.title == 1>>Master<<else>>Mistress<</if>> is taking an interest in her.
<<elseif $activeSlave.devotion > 50>>
devoted girl <<if $activeSlave.amp != 1>>hurries in promptly<<else>>comes in as soon as she can get another slave to carry her in<</if>>, eager to do whatever you demand of her.
<<elseif $activeSlave.devotion > 20>>
girl, broken to your will, <<if $activeSlave.amp != 1>>comes in promptly<<else>>comes in as soon as she can get another slave to carry her in<</if>>, clearly ready to follow orders.
<<elseif ($activeSlave.trust < -20) && ($activeSlave.devotion > -10)>>
fearful slave <<if $activeSlave.amp != 1>>comes in promptly<<else>>comes in as soon as she can get another slave to carry her in<</if>>, afraid of what will happen to her if she doesn't.
<<elseif ($activeSlave.trust < -50)>>
terrified slave <<if $activeSlave.amp != 1>>comes in hurriedly<<else>>comes in as soon as she can get another slave to carry her in<</if>>, almost paralyzed by terror of what will happen to her if she doesn't.
<<else>>
rebellious slave <<if $activeSlave.amp != 1>>comes in slowly, having decided that she can always decide to resist once she hears what you want<<else>>comes in as soon as you order another slave to carry her in, since she can't exactly resist this without limbs<</if>>.
<</if>>
You tell her she's to report to <<if $Madam != 0>>$Madam.slaveName immediately, to serve in the $brothelName<<else>>the $brothelName immediately, to serve there<</if>> until further notice.
<br><br>
<<if $activeSlave.devotion > 50>>
<<if ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetish != "none")>>
She looks excited. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>, I hoped you would <<if SlaveStatsChecker.checkForLisp($activeSlave)>>thend<<else>>send<</if>> me down there <<if SlaveStatsChecker.checkForLisp($activeSlave)>>thometime<<else>>sometime!<</if>>
<<if ($activeSlave.fetish is "submissive")>>
I mean, I'll have to do whatever the customer<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pay for, right?" Her eyes go a little unfocused. "And, they'll hold me down..." She trails off.
<<elseif ($activeSlave.fetish is "masochist")>>
I mean, it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> hard being a brothel whore, right? And when I get tired or <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ore, I'll <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>till be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>old. Even when it hurt<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> me to fuck any more." Her eyes glow with an unhealthy light.
<<elseif ($activeSlave.fetish is "cumslut")>>
I mean," she licks her lips unconsciously,
<<if $activeSlave.attrXX > $activeSlave.attrXY>>
"I hear there are <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome nice ladie<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that go there for lunchtime cunnilingu<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>."
<<else>>
"the blowjob<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t, the blowjob<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>. That'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all."
<</if>>
<<elseif ($activeSlave.fetish is "humiliation")>>
There'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> a window that face<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> the hallway there, right? <<if $Madam != 0>>Do you think $Madam.slaveName would let me<<else>>Could I<</if>> get fucked there? Where everyone could <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ee me being fucked for money?"
<<elseif ($activeSlave.fetish is "buttslut")>>
I mean," and she shifts her weight, her mind obviously on her backdoor,
<<if $activeSlave.attrXX > $activeSlave.attrXY>>
"there have to be ladie<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> who want to buttfuck a whore, right? At lea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t, I really hope there are."
<<else>>
"the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> tell me that whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there get fucked up the a<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>> all day and all night. <<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th<<else>>S<</if>>ounds like fun to me."
<</if>>
<<elseif ($activeSlave.fetish is "boobs")>>
I mean," and she sticks out her chest a little,
<<if $activeSlave.attrXX > $activeSlave.attrXY>>
"I hear from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> nice lady who goes there every morning and pay<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to have a whore <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uck her nipple<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> for, like, an hour. I," she licks her lips, "could do that."
<<else>>
"the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> tell me that whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there get tittyfucked all the time. <<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th<<else>>S<</if>>ounds like fun to me."
<</if>>
<<elseif ($activeSlave.fetish is "pregnancy")>>
I mean," she says meditatively,
<<if $activeSlave.attrXX > $activeSlave.attrXY>>
"I hear from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pregnant lady who goes there every night and pay<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to have a whore cuddle her. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t cuddle, all night. That would be kind of hard, ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t cuddling, but I could do it."
<<elseif $activeSlave.vagina is -1>>
"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ince it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it take<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to get a butthole pregnant? I'm gonna try, anyway."
<<elseif isFertile($activeSlave)>>
"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ince it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it would take to get my poor womb pregnant?"
<<elseif $activeSlave.preg > 0>>
"I'm going to be a pregnant whore. That'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pretty fucking <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>exy."
<<else>>
"I'm can't wait till I can get pregnant. That'd be pretty fucking <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>exy."
<</if>>
<<elseif ($activeSlave.fetish is "dom")>>
I heard from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> bring their girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t to make them take it from a whore."
<<elseif ($activeSlave.fetish is "sadist")>>
I heard from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> bring their girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there. Because nobody know<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> how to hurt a bitch like a whore doe<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>." She shivers.
<</if>>
<<else>>
She looks determined. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>, I will do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t to be a good whore, and get lot<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> of citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to pay good money for my body."
<</if>>
<<elseif ($activeSlave.devotion > 20) || (($activeSlave.devotion >= -20) && ($activeSlave.trust < -20) && ($activeSlave.trust >= -50))>>
<<if ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetish != "none")>>
She looks cautiously excited. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>,
<<if ($activeSlave.fetish is "submissive")>>
I'll have to do whatever the customer<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pay for, right?" Her eyes go a little unfocused. "And, they'll hold me down..." She trails off.
<<elseif ($activeSlave.fetish is "masochist")>>
it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> hard being a brothel whore, right? And when I get tired or <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ore, I'll <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>till be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>old. Even when it hurt<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> me to fuck any more." Her eyes glow with an unhealthy light.
<<elseif ($activeSlave.fetish is "cumslut")>>
<<if $activeSlave.attrXX > $activeSlave.attrXY>>
"I hear there are <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome nice ladie<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that go there for lunchtime cunnilingu<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>."
<<else>>
"the blowjob<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t, the blowjob<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>. That'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all."
<</if>>
<<elseif ($activeSlave.fetish is "humiliation")>>
there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> a window that face<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> the hallway there, right? <<if $Madam != 0>>Do you think $Madam.slaveName would let me<<else>>Could I<</if>> get fucked there? Where everyone could <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ee me being fucked for money?"
<<elseif ($activeSlave.fetish is "buttslut")>>
uh," and she shifts her weight, her mind obviously on her backdoor,
<<if $activeSlave.attrXX > $activeSlave.attrXY>>
"there have to be ladie<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> who want to buttfuck a whore, right? At lea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t, I really hope there are."
<<else>>
"the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> tell me that whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there get fucked up the a<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>> all day and all night. <<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th<<else>>S<</if>>ounds like fun to me."
<</if>>
<<elseif ($activeSlave.fetish is "boobs")>>
er," and she sticks out her chest a little,
<<if $activeSlave.attrXX > $activeSlave.attrXY>>
"I hear from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> nice lady who goes there every morning and pay<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to have a whore <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uck her nipple<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> for, like, an hour. I," she licks her lips, "could do that."
<<else>>
"the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> tell me that whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there get tittyfucked all the time. <<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th<<else>>S<</if>>ounds like fun to me."
<</if>>
<<elseif ($activeSlave.fetish is "pregnancy")>>
<<if $activeSlave.attrXX > $activeSlave.attrXY>>
I hear from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pregnant lady who goes there every night and pay<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to have a whore cuddle her. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t cuddle, all night. That would be kind of hard, ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t cuddling, but I could do it."
<<elseif $activeSlave.vagina is -1>>
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ince it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it take<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> to get a butthole pregnant? I'm gonna try, anyway."
<<elseif isFertile($activeSlave)>>
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ince it'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> all bareback, I'm going to have a fuckton of cum in me. I wonder how much cum it would take to get my poor womb pregnant?"
<<elseif $activeSlave.preg > 0>>
I'm going to be a pregnant whore. That'<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> pretty fucking <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>exy."
<<else>>
"I'm can't wait till I can get pregnant. That'd be pretty fucking <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>exy."
<</if>>
<<elseif ($activeSlave.fetish is "dom")>>
I heard from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> bring their girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there. Ju<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t to make them take it from a whore."
<<elseif ($activeSlave.fetish is "sadist")>>
I heard from the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> that <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome citizen<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> bring their girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> there. Because nobody know<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> how to hurt a bitch like a whore doe<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>." She shivers.
<</if>>
<<elseif $activeSlave.sexualFlaw != "none">>
"Yes, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>," she says obediently. She hesitates, looking concerned.
<<if ($activeSlave.sexualFlaw is "hates oral")>>
"I - I'm going to h-have to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uck a lot of dick there, aren't I." She swallows nervously. Her lower lip quivers, and she does her best not to cry in front of you.
<<elseif ($activeSlave.sexualFlaw is "hates anal")>>
"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>C-cuthtomerth<<else>>C-customers<</if>> are really going to ream me up the butt hole, aren't they." She <<if $activeSlave.amp == 1>>shifts uncomfortably, unconsciously trying to shield her rear as best she can manage without limbs.<<else>>unconsciously reaches around behind herself, not quite shielding her anus with her hands.<</if>> Her lower lip quivers, and she does her best not to cry in front of you.
<<elseif ($activeSlave.sexualFlaw is "hates penetration")>>
"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>C-cuthtomerth<<else>>C-customers<</if>> are really going to fuck me <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ore, aren't they." She <<if $activeSlave.amp == 1>>shifts uncomfortably, unconsciously trying to shield her rear as best she can manage without limbs.<<elseif $activeSlave.vagina > 0>>unconsciously lets her hands fall to her crotch, but catches herself and doesn't quite shield her pussy.<<else>>unconsciously reaches around behind herself, not quite shielding her anus with her hands.<</if>> Her lower lip quivers, and she does her best not to cry in front of you.
<<elseif ($activeSlave.sexualFlaw is "repressed")>>
"Being a whore is a <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>in," she says quietly, half to herself. "I'm going t-to b-be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>o dirty. I'm going to h-hell." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. I'll do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t."
<<elseif ($activeSlave.sexualFlaw is "idealistic")>>
"I'm going to be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>old for <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ex," she says quietly, half to herself. "Men are going to pay, and then they're g-going to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tick their dick<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> in me, and then they're going to leave." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. I'll do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t."
<<elseif ($activeSlave.sexualFlaw is "shamefast")>>
"I'm going to be meat in a brothel," she says quietly, half to herself. "I'm going to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tand there naked with the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>, and men will pick me and then u<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>e my body. Over and over." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. I'll do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t."
<<elseif ($activeSlave.sexualFlaw is "apathetic")>>
"I gue<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>> I'll lie there," she sighs quietly, half to herself. "A man will pay and then he'll come in to my room where I'm lying on the bed, and he'll <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tick his cock in me and cum and leave. And then the next man will come in." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. I'll do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t."
<<elseif ($activeSlave.sexualFlaw is "crude")>>
"Okay," she says, thinking. "My poor cornhole is going to be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uch a <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>eminal <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ewer." She looks doubtful. "Should I not have <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>aid that, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>?"
<<elseif ($activeSlave.sexualFlaw is "judgemental")>>
"Gro<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>>," she says curtly. "Well, no more hand<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome boy<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> for me, then. Fat pathetic guy<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> who patronize whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>, all the way down. Fuck."
<</if>>
<<else>>
She tries to be brave. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>, I will do my be<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>t to be a good whore." Then, half to herself, she adds in a small voice, "I can do thi<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>."
<</if>>
<<elseif ($activeSlave.trust < -20)>>
<<if $activeSlave.sexualFlaw != "none">>
"Yes, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>," she says automatically. She's badly frightened, and says in a small voice, half to herself,
<<if ($activeSlave.sexualFlaw is "hates oral")>>
"I - I'm going to h-have to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uck a lot of dick, aren't I." She swallows and tries to control herself out of fear, but finally gasps out, "Oh God, I'm <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>cared," and bursts into tears.
<<elseif ($activeSlave.sexualFlaw is "hates anal")>>
"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>C-cuthtomerth<<else>>C-customers<</if>> are really going to ream me up the butt hole, aren't they." She <<if $activeSlave.amp == 1>>shifts uncomfortably, unconsciously trying to shield her rear as best she can manage without limbs.<<else>>unconsciously reaches around behind herself, not quite shielding her anus with her hands.<</if>> Her lower lip quivers and she tries to control herself out of fear, but finally gasps out, "Oh God, I'm <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>cared," and bursts into tears.
<<elseif ($activeSlave.sexualFlaw is "hates penetration")>>
"<<if SlaveStatsChecker.checkForLisp($activeSlave)>>C-cuthtomerth<<else>>C-customers<</if>> are really going to fuck me <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ore, aren't they." She <<if $activeSlave.amp == 1>>shifts uncomfortably, unconsciously trying to shield her rear as best she can manage without limbs.<<elseif $activeSlave.vagina > 0>>unconsciously lets her hands fall to her crotch, but catches herself and doesn't quite shield her pussy.<<else>>unconsciously reaches around behind herself, not quite shielding her anus with her hands.<</if>> Her lower lip quivers, and she tries to control herself out of fear, but finally gasps out, "Oh God, I'm <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>cared," and bursts into tears.
<<elseif ($activeSlave.sexualFlaw is "repressed")>>
"Being a whore is a <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>in," she says quietly, half to herself. "I'm going t-to b-be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>o dirty. I'm going to h-hell." She starts to cry quietly. She tries to get herself back under control, out of fear, but finally wails, "Oh God, I'm <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>orry, p-plea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>e forgive me God," and dissolves into sobbing.
<<elseif ($activeSlave.sexualFlaw is "idealistic")>>
"I'm going to be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>old for <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ex," she says quietly, half to herself. "Men are going to pay, and then they're g-going to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tick their dick<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> in me, and then they're going to leave." She starts to cry openly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. P-plea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>se don't beat me. I'll do it."
<<elseif ($activeSlave.sexualFlaw is "shamefast")>>
"I'm going to be meat in a brothel," she says quietly, half to herself. "I'm going to <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tand there naked with the other girl<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>, and men will pick me and then u<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>e my body. Over and over." She starts to cry openly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. P-plea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>se don't beat me. I'll do it."
<<elseif ($activeSlave.sexualFlaw is "apathetic")>>
"I gue<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>> I'll lie there," she sighs quietly, half to herself. "A man will pay and then he'll come in to my room where I'm lying on the bed, and he'll <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>tick his cock in me and cum and leave. And then the next man will come in." She starts to cry quietly. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>>Th-th<<else>>S-s<</if>>orry, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>. P-plea<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>se don't beat me. I'll let it happen."
<<elseif ($activeSlave.sexualFlaw is "crude")>>
"Okay," she says, thinking. "My poor cornhole is going to be <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>uch a <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>eminal <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ewer." She looks doubtful. "Should I not have <<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>aid that, <<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>?"
<<elseif ($activeSlave.sexualFlaw is "judgemental")>>
"Gro<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>ss<</if>>," she says curtly. "Well, no more hand<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>ome boy<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> for me, then. Fat pathetic guy<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>> who patronize whore<<if SlaveStatsChecker.checkForLisp($activeSlave)>>th<<else>>s<</if>>, all the way down. Fuck."
<</if>>
<<else>>
She does her best to control herself and avoid punishment. "<<if SlaveStatsChecker.checkForLisp($activeSlave)>><<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>><<else>><<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>><</if>>, I will." She holds herself together until you dismiss her; as she turns away to go, the tears come fast, and she almost runs into the doorframe on her way out, blind with weeping.
<</if>>
<<else>>
She manages to get "Oh fuck n-" out before the compliance systems activate and she's poleaxed to the ground. Anticipating this, you had <<if $Madam != 0>>$Madam.slaveName <<else>>another, more obedient slave<</if>> standing by to haul her away. It'll take a couple of hundred customers, but being sold in a brothel for rape should knock the resistance out of her.
<</if>> /* CLOSES DEVOTION */
<</nobr>>
|
r3d/fc
|
src/facilities/brothel/brothelAssignmentScene.tw
|
tw
|
bsd-3-clause
| 32,797
|
:: accordionStyleSheet [stylesheet]
/* Accordion 000-250-006 */
button.accordion {
cursor: pointer;
padding: 5px;
width: 100%;
margin-bottom: 10px;
border-bottom: 3px double;
border-right: 3px double;
border-left: none;
border-top: none;
text-align: left;
outline: none;
transition: 0.4s;
background-color: transparent;
}
button.accordion.active, button.accordion:hover {
background-color: transparent;
}
button.accordion:before {
content: '\002B';
color: #777;
font-weight: bold;
float: left;
margin-right: 5px;
}
button.accordion.active:before {
content: "\2212";
}
.accHidden {
padding: 0 18px;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
}
|
r3d/fc
|
src/gui/css/accordianStyleSheet.tw
|
tw
|
bsd-3-clause
| 768
|
:: Main stylesheet [stylesheet]
/* clears SugarCube's default transition */
.passage {
transition: none;
-webkit-transition: none;
}
/* default is 54em */
#passages {
max-width: 76em;
}
.imageRef {
display: flex;
flex-direction: column;
flex-wrap: wrap;
align-items: flex-start;
position: relative;
}
.tinyImg {
height: 120px;
width: 120px;
float: left;
}
.smlImg {
height: 150px;
width: 150px;
float: left;
}
.medImg {
height: 300px;
width: 300px;
float: right;
}
.lrgImg {
height: 600px;
width: 600px;
margin-right: -100px;
margin-left: -100px;
float: right;
}
object {
object-fit: scale-down;
position: absolute;
}
|
r3d/fc
|
src/gui/css/mainStyleSheet.tw
|
tw
|
bsd-3-clause
| 763
|
:: Alpha disclaimer
<<set $ui to "start">>\
//v. $ver//
@@color:green;//Mod: expanded age ranges and other tweaks 2016-08-30//@@ @@color:darkred;+SV@@
@@color:green;//Mod: extra preg content and other crap//@@
''This is an alpha.'' That means the game is missing content, is full of bugs, is imbalanced, and is generally in an incomplete state. The game will keep a start of turn autosave. If you encounter a bug, I strongly recommend you reload your start of turn autosave immediately. Bugs will occasionally cause a bugged slave named $activeSlave.slaveName (or similar) to appear. If this happens, use the "Discard her" option on the slave menu to get rid of her. Then, please report the circumstances (especially what random event you just saw) to the dev. Please submit your feedback and bug reports at https://www.reddit.com/r/freecitiesgame/ or at http://freecitiesblog.blogspot.com/.
An in-game encyclopedia is available from the sidebar (or [[here|Encyclopedia][$nextButton to "Back", $nextLink to passage()]] if you'd prefer to have a look before starting), with answers to most basic gameplay questions.
__Important note for new players, and a reminder for FC veterans:__ when the player is offered a set of choices, the ''Continue'' button at the top of the left sidebar will almost always remain available. Using this to decline all the options presented is //not cheating.// If it's available, it's supposed to be available. It represents the player character politely bowing out of the situation.
If you enjoy FC and feel like using your real-life ¤ to express gratitude, you can do so at https://www.patreon.com/freecitiesdev?ty=h. It's a tip jar, not support for more content. I'm doing this for fun; let's keep it that way.
''Saves from versions prior to 0.6 are not compatible.''
@@color:yellow;This is a text-based game that includes descriptions of sexual activity, graphic violence, drug use, and other subjects not suitable for persons under the age of 18. This is a work of fiction; any resemblance to actual persons, places, or events is unintended.@@
[[I am 18 or more years of age, I understand, and I wish to continue|Economy Intro]]
|
r3d/fc
|
src/gui/mainMenu/AlphaDisclaimer.tw
|
tw
|
bsd-3-clause
| 2,171
|
:: accordionJS.tw [script]
/* Accordion 000-250-006 */
/*
* We're making changes to the DOM, so we need to make them *after* everything has been generated
* Sticking this all in postdisplay calls reduces the chance of there being a timing conflict
* with other scripts, since anything poking the DOM here will be done last
*
* Dev Note: The accordion mod should be able to turn *anything* into an accordion. This iteration
* is configured tightly for the end of week report runs, but it shouldn't be that hard to adapt for
* other uses, like character bios. For now, I'll see what other extra-long passages of cosmetic text
* might benefit.
*
* 000-250-006 03092017
*/
postdisplay["doAccordionSet"] = function (content) {
if (variables().useAccordion == 1) {
Array.prototype.slice.call(document.querySelectorAll('.macro-include'))
.forEach(function(element) {
element.classList.add('accHidden');
});
}
}
postdisplay["doAccordion"] = function (content) {
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i += 1) {
acc[i].onclick = function () {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
};
}
};
|
r3d/fc
|
src/js/accordianJS.tw
|
tw
|
bsd-3-clause
| 1,478
|
:: StoryJS [script]
/*config.history.tracking = false;*/
window.variableAsNumber = function(x, defaultValue, minValue, maxValue) {
x = Number(x)
if (x != x) {//NaN
return defaultValue || 0;//In case the default value was not supplied.
}
if (x < minValue) {//Works even if minValue is undefined.
return minValue;
}
if (x > maxValue) {//Works even if maxValue is undefined.
return maxValue;
}
return x;
};
window.isSexuallyPure = function(slave) {
if (!slave) {
return null;
}
if (slave.vagina < 1 && slave.anus < 1 && !slave.analCount && !slave.vaginalCount && !slave.oralCount) {
return true;
} else {
return false;
}
};
if (typeof interpolate == "undefined") {
var interpolate = function(x0,y0,x1,y1,x) {
if(x <= x0) {
return y0;
} else if(x >= x1) {
return y1;
} else {
return (x - x0) * ((y1 - y0) / (x1 - x0)) + y0;
}
};
window.interpolate = interpolate;
}
config.history.maxStates = 1;
config.saves.autosave = "autosave";
window.isFullyPotent = function(slave) {
if (!slave) {
return null;
} else if (slave.dick > 0 && slave.balls > 0 && slave.hormones <= 0) {
return true;
} else {
return false;
}
};
/* mousetrap v1.5.3 craig.is/killing/mice */
(function(C,r,g){function t(a,b,h){a.addEventListener?a.addEventListener(b,h,!1):a.attachEvent("on"+b,h)}function x(a){if("keypress"==a.type){var b=String.fromCharCode(a.which);a.shiftKey||(b=b.toLowerCase());return b}return l[a.which]?l[a.which]:p[a.which]?p[a.which]:String.fromCharCode(a.which).toLowerCase()}function D(a){var b=[];a.shiftKey&&b.push("shift");a.altKey&&b.push("alt");a.ctrlKey&&b.push("ctrl");a.metaKey&&b.push("meta");return b}function u(a){return"shift"==a||"ctrl"==a||"alt"==a||
"meta"==a}function y(a,b){var h,c,e,g=[];h=a;"+"===h?h=["+"]:(h=h.replace(/\+{2}/g,"+plus"),h=h.split("+"));for(e=0;e<h.length;++e)c=h[e],z[c]&&(c=z[c]),b&&"keypress"!=b&&A[c]&&(c=A[c],g.push("shift")),u(c)&&g.push(c);h=c;e=b;if(!e){if(!k){k={};for(var m in l)95<m&&112>m||l.hasOwnProperty(m)&&(k[l[m]]=m)}e=k[h]?"keydown":"keypress"}"keypress"==e&&g.length&&(e="keydown");return{key:c,modifiers:g,action:e}}function B(a,b){return null===a||a===r?!1:a===b?!0:B(a.parentNode,b)}function c(a){function b(a){a=
a||{};var b=!1,n;for(n in q)a[n]?b=!0:q[n]=0;b||(v=!1)}function h(a,b,n,f,c,h){var g,e,l=[],m=n.type;if(!d._callbacks[a])return[];"keyup"==m&&u(a)&&(b=[a]);for(g=0;g<d._callbacks[a].length;++g)if(e=d._callbacks[a][g],(f||!e.seq||q[e.seq]==e.level)&&m==e.action){var k;(k="keypress"==m&&!n.metaKey&&!n.ctrlKey)||(k=e.modifiers,k=b.sort().join(",")===k.sort().join(","));k&&(k=f&&e.seq==f&&e.level==h,(!f&&e.combo==c||k)&&d._callbacks[a].splice(g,1),l.push(e))}return l}function g(a,b,n,f){d.stopCallback(b,
b.target||b.srcElement,n,f)||!1!==a(b,n)||(b.preventDefault?b.preventDefault():b.returnValue=!1,b.stopPropagation?b.stopPropagation():b.cancelBubble=!0)}function e(a){"number"!==typeof a.which&&(a.which=a.keyCode);var b=x(a);b&&("keyup"==a.type&&w===b?w=!1:d.handleKey(b,D(a),a))}function l(a,c,n,f){function e(c){return function(){v=c;++q[a];clearTimeout(k);k=setTimeout(b,1E3)}}function h(c){g(n,c,a);"keyup"!==f&&(w=x(c));setTimeout(b,10)}for(var d=q[a]=0;d<c.length;++d){var p=d+1===c.length?h:e(f||
y(c[d+1]).action);m(c[d],p,f,a,d)}}function m(a,b,c,f,e){d._directMap[a+":"+c]=b;a=a.replace(/\s+/g," ");var g=a.split(" ");1<g.length?l(a,g,b,c):(c=y(a,c),d._callbacks[c.key]=d._callbacks[c.key]||[],h(c.key,c.modifiers,{type:c.action},f,a,e),d._callbacks[c.key][f?"unshift":"push"]({callback:b,modifiers:c.modifiers,action:c.action,seq:f,level:e,combo:a}))}var d=this;a=a||r;if(!(d instanceof c))return new c(a);d.target=a;d._callbacks={};d._directMap={};var q={},k,w=!1,p=!1,v=!1;d._handleKey=function(a,
c,e){var f=h(a,c,e),d;c={};var k=0,l=!1;for(d=0;d<f.length;++d)f[d].seq&&(k=Math.max(k,f[d].level));for(d=0;d<f.length;++d)f[d].seq?f[d].level==k&&(l=!0,c[f[d].seq]=1,g(f[d].callback,e,f[d].combo,f[d].seq)):l||g(f[d].callback,e,f[d].combo);f="keypress"==e.type&&p;e.type!=v||u(a)||f||b(c);p=l&&"keydown"==e.type};d._bindMultiple=function(a,b,c){for(var d=0;d<a.length;++d)m(a[d],b,c)};t(a,"keypress",e);t(a,"keydown",e);t(a,"keyup",e)}var l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",
20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},p={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},A={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},z={option:"alt",command:"meta","return":"enter",
escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},k;for(g=1;20>g;++g)l[111+g]="f"+g;for(g=0;9>=g;++g)l[g+96]=g;c.prototype.bind=function(a,b,c){a=a instanceof Array?a:[a];this._bindMultiple.call(this,a,b,c);return this};c.prototype.unbind=function(a,b){return this.bind.call(this,a,function(){},b)};c.prototype.trigger=function(a,b){if(this._directMap[a+":"+b])this._directMap[a+":"+b]({},a);return this};c.prototype.reset=function(){this._callbacks={};this._directMap=
{};return this};c.prototype.stopCallback=function(a,b){return-1<(" "+b.className+" ").indexOf(" mousetrap ")||B(b,this.target)?!1:"INPUT"==b.tagName||"SELECT"==b.tagName||"TEXTAREA"==b.tagName||b.isContentEditable};c.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)};c.init=function(){var a=c(r),b;for(b in a)"_"!==b.charAt(0)&&(c[b]=function(b){return function(){return a[b].apply(a,arguments)}}(b))};c.init();C.Mousetrap=c;"undefined"!==typeof module&&module.exports&&(module.exports=
c);"function"===typeof define&&define.amd&&define(function(){return c})})(window,document);
Mousetrap.bind("enter", function () {
$("#story-caption #endWeekButton a.macro-link").trigger("click");
});
Mousetrap.bind("space", function () {
$("#story-caption #nextButton a.macro-link").trigger("click");
});
Mousetrap.bind("c", function () {
$("#story-caption #manageArcology a.macro-link").trigger("click");
});
Mousetrap.bind("p", function () {
$("#story-caption #managePenthouse a.macro-link").trigger("click");
});
Mousetrap.bind("left", function () {
$("#prevSlave a.macro-link").trigger("click");
$("#prevRule a.macro-link").trigger("click");
});
Mousetrap.bind("q", function () {
$("#prevSlave a.macro-link").trigger("click");
$("#prevRule a.macro-link").trigger("click");
});
Mousetrap.bind("shift+left", function () {
$("#firstRule a.macro-link").trigger("click");
});
Mousetrap.bind("shift+q", function () {
$("#firstRule a.macro-link").trigger("click");
});
Mousetrap.bind("right", function () {
$("#nextSlave a.macro-link").trigger("click");
$("#nextRule a.macro-link").trigger("click");
});
Mousetrap.bind("shift+right", function () {
$("#lastRule a.macro-link").trigger("click");
});
Mousetrap.bind("e", function () {
$("#nextSlave a.macro-link").trigger("click");
$("#nextRule a.macro-link").trigger("click");
});
Mousetrap.bind("shift+e", function () {
$("#lastRule a.macro-link").trigger("click");
});
Mousetrap.bind("f", function () {
$("#walkpast a.macro-link").trigger("click");
});
Mousetrap.bind("h", function () {
$("#manageHG a.macro-link").trigger("click");
});
Mousetrap.bind("s", function () {
$("#buySlaves a.macro-link").trigger("click");
});
Mousetrap.bind("a", function () {
$("#managePA a.macro-link").trigger("click");
});
Mousetrap.bind("b", function () {
$("#manageBG a.macro-link").trigger("click");
});
Mousetrap.bind("r", function () {
$("#manageRecruiter a.macro-link").trigger("click");
});
Mousetrap.bind("o", function () {
$("#story-caption #optionsButton a.macro-link").trigger("click");
});
Mousetrap.bind("y", function () {
$("#story-caption #policyButton a.macro-link").trigger("click");
});
Mousetrap.bind("f", function () {
$("#story-caption #FSButton a.macro-link").trigger("click");
});
Mousetrap.bind("l", function () {
$("#story-caption #LanguageButton a.macro-link").trigger("click");
});
Mousetrap.bind("t", function () {
$("#story-caption #PAOButton a.macro-link").trigger("click");
});
Mousetrap.bind("u", function () {
$("#story-caption #URButton a.macro-link").trigger("click");
});
Mousetrap.bind("w", function () {
$("#story-caption #WARButton a.macro-link").trigger("click");
});
/**
* BoobGenerator namespace.
*/
if (typeof BoobGenerator == "undefined") {
var BoobGenerator = {
rollBreast: function (modif) {
var volume = [0, 300, 500, 650, 800, 1000, 1200, 1400, 1600, 1800, 2050, 2300, 2600, 2900, 3250, 3600, 3950, 4300, 4700, 5100, 5500, 5900];
var volume_dist = [90000, 470000, 720000, 840000, 908574, 947759, 970151, 982946, 990258, 994436, 996824, 998188, 998968, 999414, 999669, 999814, 999897, 999945, 999972, 999987, 999995, 1000000];
var randomRoll = Math.floor(Math.random() * 1000000) + 1
var actualSize = 0
while (randomRoll > volume_dist[actualSize]) {
actualSize = actualSize + 1
}
var minorSizeAdjustment = 0
if (Math.random()<.5) {
minorSizeAdjustment = (Math.floor(Math.random() * 2) + 1) * 50
}
var volResult = volume[actualSize] + minorSizeAdjustment + modif
if (volResult < 0) {volResult = 0}
return volResult
}
};
// Raise namespace scope to Global.
window.BoobGenerator = BoobGenerator;
};
/**
* Slave checker namespace.
*/
if (typeof SlaveStatsChecker == "undefined") {
var SlaveStatsChecker = {
checkForLisp: function (slave) {
/* Begin mod section: toggle whether slaves lisp. */
if (SugarCube && SugarCube.State.variables.disableLisping) {
return false;
}
/* End mod section: toggle whether slaves lisp. */
return ((slave.lips > 70) || (slave.lipsPiercing + slave.tonguePiercing > 2))
}
};
// Raise namespace scope to Global.
window.SlaveStatsChecker = SlaveStatsChecker;
};
if (typeof FertilityAge == "undefined") {
var FertilityAge = {
setAge: function (age) {
age = Number(age)
if (age != age) {
return 13;
} else {
return age
}
}
};
// Raise namespace scope to Global.
window.FertilityAge = FertilityAge;
};
window.canGetPregnant = function(slave) {
if (!slave) {
return null;
} else if (slave.pubertyXX == 0){
return false;
} else if (slave.physicalAge >= 47) {
return false;
} else if (slave.inflation != 0) {
return false;
} else if (slave.bellyImplant != 0) {
return false;
} else if (slave.preg != 0) {
return false;
} else if ((slave.mpreg == 1) && (canDoAnal(slave) == true)) {
return true;
} else if (slave.ovaries != 1) {
return false;
} else if (canDoVaginal(slave) == false) {
return false;
} else {
return true;
}
};
window.isFertile = function(slave) {
if (!slave) {
return null;
} else if (slave.pubertyXX == 0) {
return false;
} else if (slave.physicalAge >= 47) {
return false;
} else if (slave.inflation != 0) {
return false;
} else if (slave.bellyImplant != 0) {
return false;
} else if (slave.preg > 0) {
return false;
} else if (slave.preg < -1) {
return false;
} else if (slave.mpreg == 1) {
return true;
} else if (slave.ovaries != 1) {
return false;
} else {
return true;
}
};
window.canBreed = function(slave1, slave2) {
if (slave1.eggType == slave2.ballType) {
return true;
} else {
return false;
}
};
//is the slave's belly big enough to get in the way
window.bigBellyPreg = function(slave) {
if (!slave) {
return null;
} else if (slave.preg > 0 && slave.pregType >= 20) {
return true;
} else if (slave.preg > 10 && slave.pregType >= 10) {
return true;
} else if (slave.preg > 20) {
return true;
} else {
return false;
}
};
window.bigBelly = function(slave) {
if (!slave) {
return null;
} else if (bigBellyPreg(slave) == true) {
return true;
} else if (slave.inflation > 2) {
return true;
} else if (slave.bellyImplant > 8000) {
return true;
} else {
return false;
}
};
window.canAchieveErection = function(slave) {
if (!slave) {
return null;
} else if (slave.dick < 7 && slave.dick > 0 && (slave.balls > 0 ? slave.hormones <= 0 : slave.hormones < 0)) {
return true;
} else {
return false;
}
};
window.canPenetrate = function(slave) {
if (!slave) {
return null;
} else if (canAchieveErection(slave) == false) {
return false;
} else if (slave.dickAccessory == "chastity") {
return false;
} else if (slave.dickAccessory == "combined chastity") {
return false;
} else if (slave.dick > 7) {
return false;
}
return true;
};
window.canSee = function(slave) {
if (!slave) {
return null;
} else if (slave.eyes > -2) {
return true;
} else {
return false;
}
};
window.canWalk = function(slave) {
if (!slave) {
return null;
} else if (slave.amp == 1) {
return false;
} else if (slave.boobs > 9000+(slave.muscles*100) && slave.physicalAge >= 18) {
return false;
} else if (slave.boobs > 5000+(slave.muscles*10) && slave.physicalAge <= 3) {
return false;
} else if (slave.boobs > 7000+(slave.muscles*20) && slave.physicalAge <= 12) {
return false;
} else if (slave.boobs > 9000+(slave.muscles*50) && slave.physicalAge < 18) {
return false;
} else if (slave.dick >= 15+(slave.muscles*.2) && slave.physicalAge <= 3) {
return false;
} else if (slave.dick >= 30+(slave.muscles*.3) && slave.physicalAge <= 12) {
return false;
} else if (slave.dick >= 68+(slave.muscles*.4)) {
return false;
} else if (slave.balls >= 30+(slave.muscles*.3) && slave.physicalAge <= 3) {
return false;
} else if (slave.balls >= 60+(slave.muscles*.5) && slave.physicalAge <= 12) {
return false;
} else if (slave.balls >= 90+(slave.muscles*.7)) {
return false;
} else if (slave.butt > 10 && slave.physicalAge <= 3) {
return false;
} else if (slave.butt > 14 && slave.physicalAge <= 12) {
return false;
} else if (slave.preg > 20 && slave.physicalAge >= 13 && slave.pregType >= 20 && slave.height < 150) {
return false;
} else if (slave.preg > 30 && slave.physicalAge >= 13 && slave.pregType >= 20 && (!slave.height >= 185 || !slave.muscles > 1)) {
return false;
} else if (slave.preg > 20 && slave.physicalAge <= 3 && slave.pregType >= 10) {
return false;
} else if (slave.preg > 20 && slave.physicalAge <= 12 && slave.pregType >= 20) {
return false;
} else if (slave.bellyImplant > 31000+(slave.muscles*100) && slave.physicalAge >= 18) {
return false;
} else if (slave.bellyImplant > 31000+(slave.muscles*80) && slave.physicalAge >= 13) {
return false;
} else if (slave.bellyImplant > 12000+(slave.muscles*50) && slave.physicalAge <= 3) {
return false;
} else if (slave.bellyImplant > 16000+(slave.muscles*20) && slave.physicalAge <= 12) {
return false;
} else if (slave.heels == 0) {
return true;
} else if (slave.shoes == "heels") {
return true;
} else if (slave.shoes == "extreme heels") {
return true;
} else if (slave.shoes == "boots") {
return true;
} else {
return false;
}
};
window.canTalk = function(slave) {
if (!slave) {
return null;
} else if (slave.accent > 2) {
return false;
} else if (slave.voice == 0) {
return false;
} else if (slave.lips > 95) {
return false;
} else {
return true;
}
};
window.canDoAnal = function(slave) {
if (!slave) {
return null;
} else if (slave.vaginalAccessory == "anal chastity") {
return false;
} else if (slave.dickAccessory == "anal chastity") {
return false;
} else if (slave.vaginalAccessory == "combined chastity") {
return false;
} else if (slave.dickAccessory == "combined chastity") {
return false;
}
return true;
};
window.canDoVaginal = function(slave) {
if (!slave) {
return null;
} else if (slave.vagina < 0) {
return false;
} else if (slave.vaginalAccessory == "chastity belt") {
return false;
} else if (slave.vaginalAccessory == "combined chastity") {
return false;
}
return true;
};
window.tooBigBreasts = function(slave){
if (!slave) {
return null;
} else if (slave.boobs > 9000+(slave.muscles*100) && slave.physicalAge >= 18) {
return true;
} else if (slave.boobs > 5000+(slave.muscles*10) && slave.physicalAge <= 3) {
return true;
} else if (slave.boobs > 7000+(slave.muscles*20) && slave.physicalAge <= 12) {
return true;
} else if (slave.boobs > 9000+(slave.muscles*50) && slave.physicalAge < 18) {
return true;
} else {
return false;
}
};
window.tooBigBelly = function(slave){
if (!slave) {
return null;
} else if (slave.preg > 20 && slave.physicalAge >= 18 && slave.pregType >= 20 && slave.height < 150) {
return true;
} else if (slave.preg > 30 && slave.physicalAge >= 18 && slave.pregType >= 20 && (!slave.height >= 185 || !slave.muscles > 1)) {
return true;
} else if (slave.preg > 20 && slave.physicalAge <= 3 && slave.pregType >= 10) {
return true;
} else if (slave.preg > 20 && slave.physicalAge <= 12 && slave.pregType >= 20) {
return true;
} else if (slave.bellyImplant > 31000+(slave.muscles*100) && slave.physicalAge >= 18) {
return true;
} else if (slave.bellyImplant > 31000+(slave.muscles*80) && slave.physicalAge >= 13) {
return true;
} else if (slave.bellyImplant > 12000+(slave.muscles*20) && slave.physicalAge <= 3) {
return true;
} else if (slave.bellyImplant > 16000+(slave.muscles*50) && slave.physicalAge <= 12) {
return true;
} else {
return false;
}
};
window.tooBigBalls = function(slave){
if (!slave) {
return null;
} else if (slave.balls >= 30+(slave.muscles*.3) && slave.physicalAge <= 3) {
return true;
} else if (slave.balls >= 60+(slave.muscles*.5) && slave.physicalAge <= 12) {
return true;
} else if (slave.balls >= 90+(slave.muscles*.7)) {
return true;
} else {
return false;
}
};
window.tooBigDick = function(slave){
if (!slave) {
return null;
} else if (slave.dick >= 15+(slave.muscles*.2) && slave.physicalAge <= 3) {
return true;
} else if (slave.dick >= 30+(slave.muscles*.3) && slave.physicalAge <= 12) {
return true;
} else if (slave.dick >= 68+(slave.muscles*.4)) {
return true;
} else {
return false;
}
};
window.tooBigButt = function(slave){
if (!slave) {
return null;
} else if (slave.butt > 10 && slave.physicalAge <= 3) {
return true;
} else if (slave.butt > 14 && slave.physicalAge <= 12) {
return true;
} else {
return false;
}
};
/*
window.sameTParent = function(slave1, slave2) {
if ((slave1.mother == slave2.father || slave1.father == slave2.mother) && (slave1.mother != 0 && slave1.mother != -2 && slave1.father != 0 && slave1.father != -2)) {
return true; //testtest catches the case if a mother is a father or a father a mother
} else {
return false;
}
};
*/
// testtest catches the case if a mother is a father or a father a mother
window.sameTParent = function(slave1, slave2) {
if (slave1.mother == slave2.father && slave1.father == slave2.mother && slave1.mother != 0 && slave1.mother != -2 && slave1.father != 0 && slave1.father != -2) {
return 2;
} else if ((slave1.mother == slave2.father || slave1.father == slave2.mother) && slave1.mother != 0 && slave1.mother != -2 && slave2.mother != 0 && slave2.mother != -2) {
return 3;
} else {
return 0;
}
};
window.sameDad = function(slave1, slave2){
if ((slave1.father == slave2.father) && (slave1.father != 0 && slave1.father != -2)) {
return true;
} else {
return false;
}
};
window.sameMom = function(slave1, slave2){
if ((slave1.mother == slave2.mother) && (slave1.mother != 0 && slave1.mother != -2)) {
return true;
} else {
return false;
}
};
window.areTwins = function(slave1, slave2) {
if (sameDad(slave1, slave2) == false) {
return false;
} else if (sameMom(slave1, slave2) == false) {
return false;
} else if (slave1.actualAge == slave2.actualAge && slave1.birthWeek == slave2.birthWeek) {
return true;
} else {
return false;
}
};
/*
//3 = half-sisters, 2 = sisters, 1 = twins, 0 = not related
window.areSisters = function(c1, c2) {
if(c1.ID == c2.ID) {
return 0;
}
var sib = 4;
if(sameMom(c1, c2)) {
sib -= 1;
}
if(sameDad(c1, c2)) {
sib -=1;
}
if (sib == 2 && c1.actualAge == c2.actualAge && c1.birthWeek == c2.birthWeek) {
sib -= 1;
}
if(sib == 4) {
return 0
} else {
return sib;
}
}
*/
window.areSisters = function(slave1, slave2) {
if (slave1.ID == slave2.ID) {
return 0; //you are not your own sister
} else if ((slave1.father != 0 && slave1.father != -2) || (slave1.mother != 0 && slave1.mother != -2)) {
if (sameDad(slave1, slave2) == false && sameMom(slave1, slave2) == true) {
return 3; //half sisters
} else if (sameDad(slave1, slave2) == true && sameMom(slave1, slave2) == false) {
return 3; //half sisters
} else if (sameTParent(slave1, slave2) == 3) {
return 3; //half sisters
} else if (sameTParent(slave1, slave2) == 2) {
return 2; //sisters
} else if (sameDad(slave1, slave2) == true && sameMom(slave1, slave2) == true) {
if (slave1.actualAge == slave2.actualAge && slave1.birthWeek == slave2.birthWeek) {
return 1; //twins
} else {
return 2; //sisters
}
} else {
return 0; //not related
}
} else {
return 0; //not related
}
};
window.totalRelatives = function(slave) {
var relatives = 0;
if (slave.mother > 0) {
relatives += 1
}
if (slave.father > 0) {
relatives += 1
}
if (slave.daughters > 0) {
relatives += slave.daughters
}
if (slave.sisters > 0) {
relatives += slave.sisters
}
return relatives
};
if (typeof DairyRestraintsSetting == "undefined") {
var DairyRestraintsSetting = {
setSetting: function (setting) {
setting = Number(setting)
return setting
}
};
// Raise namespace scope to Global.
window.DairyRestraintsSetting = DairyRestraintsSetting;
};
window.isSlaveAvailable = function(slave) {
if (!slave) {
return null;
} else if (slave.assignment == "be your agent") {
return false;
} else if (slave.assignment == "live with your agent") {
return false;
} else if (slave.assignment == "work in the dairy" && DairyRestraintsSetting >= 2) {
return false;
} else {
return true;
}
};
window.relationTargetWord = function(slave) {
if (!slave) {
return null;
} else if (slave.relation == "daughter") {
return "mother";
} else if (slave.relation == "mother") {
return "daughter";
}
return slave.relation;
};
window.ruleApplied = function(slave, ID) {
if (!slave) {
return null;
}else if (!slave.currentRules) {
return null;
} else {
for(var d=0; d < slave.currentRules.length; ++d){
if(slave.currentRules[d] == ID){
return true;
}
}return false;
}
};
window.ruleAssignment = function(applyAssignment, assignment) {
for(var d=0; d < applyAssignment.length; ++d){
if(applyAssignment[d] == assignment){
return true;
}
}return false;
};
window.ruleFacility = function(applyFacility, facility) {
for(var d=0; d < applyFacility.length; ++d){
if(applyFacility[d] == facility){
return true;
}
}return false;
};
window.ruleExcludeSlaveFacility = function(rule, slave) {
if (!slave) {
return null;
}else if (!rule) {
return null;
}else if (!rule.excludeFacility) {
return false;
} else {
for(var d=0; d < rule.excludeFacility.length; ++d){
if(rule.excludeFacility[d] == "hgsuite"){
if(slave.assignment == "live with your Head Girl" ){
return true;
}
else if(slave.assignment == "be your Head Girl"){
return true;
}
}
else if(rule.excludeFacility[d] == "arcade"){
if (slave.assignment == "be confined in the arcade" ){
return true;
}
}
else if(rule.excludeFacility[d] == "mastersuite"){
if(slave.assignment == "serve in the master suite" ){
return true;
}
else if(slave.assignment == "be your Concubine"){
return true;
}
}
else if(rule.excludeFacility[d] == "clinic"){
if(slave.assignment == "get treatment in the clinic" ){
return true;
}
else if(slave.assignment == "be the Nurse"){
return true;
}
}
else if(rule.excludeFacility[d] == "spa"){
if(slave.assignment == "rest in the spa" ){
return true;
}
else if(slave.assignment == "be the Attendant"){
return true;
}
}
else if(rule.excludeFacility[d] == "brothel"){
if(slave.assignment == "work in the brothel" ){
return true;
}
else if(slave.assignment == "be the Madam"){
return true;
}
}
else if(rule.excludeFacility[d] == "club"){
if(slave.assignment == "serve in the club" ){
return true;
}
else if(slave.assignment == "be the DJ"){
return true;
}
}
else if(rule.excludeFacility[d] == "dairy"){
if (slave.assignment == "work in the dairy"){
return true;
}
else if(slave.assignment == "be the Milkmaid"){
return true;
}
}
else if(rule.excludeFacility[d] == "servantsquarters"){
if(slave.assignment == "work as a servant"){
return true;
}
else if(slave.assignment == "be the Stewardess"){
return true;
}
}
else if(rule.excludeFacility[d] == "schoolroom"){
if(slave.assignment == "learn in the schoolroom" ){
return true;
}
else if(slave.assignment == "be the Schoolteacher"){
return true;
}
}
else if(rule.excludeFacility[d] == "cellblock"){
if(slave.assignment == "be confined in the cellblock" ){
return true;
}
else if(slave.assignment == "be the Wardeness"){
return true;
}
}
}
}
};
window.ruleAppliedToSlaveFacility = function(rule, slave) {
if (!slave) {
return null;
}else if (!rule) {
return null;
}else if (!rule.facility) {
return false;
} else {
for(var d=0; d < rule.facility.length; ++d){
if(rule.facility[d] == "hgsuite"){
if(slave.assignment == "live with your Head Girl" ){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be your Head Girl")){
return true;
}
}
else if(rule.facility[d] == "arcade"){
if(slave.assignment == "be confined in the arcade" ){
return true;
}
}
else if(rule.facility[d] == "mastersuite"){
if(slave.assignment == "serve in the master suite" ){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be your Concubine")){
return true;
}
}
else if(rule.facility[d] == "clinic"){
if(slave.assignment == "get treatment in the clinic" ){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Nurse")){
return true;
}
}
else if(rule.facility[d] == "spa"){
if(slave.assignment == "rest in the spa" ){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Attendant")){
return true;
}
}
else if(rule.facility[d] == "brothel"){
if(slave.assignment == "work in the brothel" ){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Madam")){
return true;
}
}
else if(rule.facility[d] == "club"){
if(slave.assignment == "serve in the club" ){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the DJ")){
return true;
}
}
else if(rule.facility[d] == "dairy"){
if (slave.assignment == "work in the dairy"){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Milkmaid")){
return true;
}
}
else if(rule.facility[d] == "servantsquarters"){
if(slave.assignment == "work as a servant" ){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Stewardess")){
return true;
}
}
else if(rule.facility[d] == "schoolroom"){
if(slave.assignment == "learn in the schoolroom" ){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Schoolteacher")){
return true;
}
}
else if(rule.facility[d] == "cellblock"){
if(slave.assignment == "be confined in the cellblock" ){
return true;
}
else if((rule.excludeSpecialSlaves != true) && (slave.assignment == "be the Wardeness")){
return true;
}
}
}return false;
}
};
window.ruleSlaveSelected = function(slave, rule) {
if (!slave) {
return null;
}else if (!rule) {
return null;
}else if (!rule.selectedSlaves) {
return false;
} else {
for(var d=0; d < rule.selectedSlaves.length; ++d){
if(slave.ID == rule.selectedSlaves[d]){
return true;
}
}return false;
}
};
window.ruleSlaveExcluded = function(slave, rule) {
if (!slave) {
return null;
}else if (!rule) {
return null;
}else if (!rule.excludedSlaves) {
return false;
} else {
for(var d=0; d < rule.excludedSlaves.length; ++d){
if(slave.ID == rule.excludedSlaves[d]){
return true;
}
}return false;
}
};
window.hasSurgeryRule = function(slave, rules) {
if (!slave) {
return false;
}else if (!rules) {
return false;
}else if (!slave.currentRules) {
return false;
}else {
for(var d=rules.length-1; d >= 0; --d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].autoSurgery > 0){
return true;
}
}
}
}return false;
}
};
window.lastPregRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return false;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].preg == -1){
return rules[d];
}
}
}
}return null;
}
};
window.hasHColorRule = function(slave, rules) {
if (!slave) {
return false;
}else if (!rules) {
return false;
}else if (!slave.currentRules) {
return false;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].hColor != "no default setting"){
return true;
}
}
}
}return false;
}
};
window.hasHStyleRule = function(slave, rules) {
if (!slave) {
return false;
}else if (!rules) {
return false;
}else if (!slave.currentRules) {
return false;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].hStyle != "no default setting"){
return true;
}
}
}
}return false;
}
};
window.hasEyeColorRule = function(slave, rules) {
if (!slave) {
return false;
}else if (!rules) {
return false;
}else if (!slave.currentRules) {
return false;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].hStyle != "no default setting"){
return true;
}
}
}
}return false;
}
};
window.lastEyeWearRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].eyewear != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastEyeColorRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].eyeColor != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastMakeupRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].makeup != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastNailsRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].nails != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastHColorRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].hColor != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastHStyleRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].hStyle != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastHLengthRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].hLength != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastPubicHColorRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].pubicHColor != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastPubicHStyleRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].pubicHStyle != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastUnderArmHColorRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].underArmHColor != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastUnderArmHStyleRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].underArmHStyle != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastNipplesPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].nipplesPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastAreolaePiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].areolaePiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastClitPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].clitPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastClitSettingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].clitSetting != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastVaginaPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].vaginaPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastDickPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].dickPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastAnusPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].anusPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastLipsPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].lipsPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastTonguePiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].tonguePiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastEarPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].earPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastEyebrowPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].earPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastNosePiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].nosePiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastNavelPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].navelPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastCorsetPiercingRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].corsetPiercing != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastBoobsTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].boobsTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastButtTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].buttTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastVaginaTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].vaginaTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastDickTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].dickTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastAnusTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].anusTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastLipsTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].lipsTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastShouldersTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].shouldersTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastArmsTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].armsTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastLegsTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].legsTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastStampTatRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].stampTat != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastLactationSurgeryRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
if (!rules[d].surgery) {
return null;
}
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].surgery.lactation != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastLipSurgeryRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
if (!rules[d].surgery) {
return null;
}
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].surgery.lips != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastBoobSurgeryRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
if (!rules[d].surgery) {
return null;
}
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].surgery.boobs != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.lastButtSurgeryRule = function(slave, rules) {
if (!slave) {
return null;
}else if (!rules) {
return null;
}else if (!slave.currentRules) {
return null;
}else {
for(var d=rules.length-1; d >= 0;--d){
if (!rules[d].surgery) {
return null;
}
for(var e=0; e < slave.currentRules.length;++e){
if(slave.currentRules[e] == rules[d].ID){
if (rules[d].surgery.butt != "no default setting"){
return rules[d];
}
}
}
}return null;
}
};
window.checkThresholds = function(number, rule) {
if (!rule) {
return null;
} else {
if ((rule.thresholdUpper != "none") && (rule.thresholdLower != "none")){
if (!rule.eqLower && !rule.eqUpper){
if((number < rule.thresholdUpper) && (number > rule.thresholdLower)){
return true;
}
}
else if (rule.eqLower && !rule.eqUpper){
if((number < rule.thresholdUpper) && (number >= rule.thresholdLower)){
return true;
}
}
else if (!rule.eqLower && rule.eqUpper){
if((number <= rule.thresholdUpper) && (number > rule.thresholdLower)){
return true;
}
}
else {
if((number <= rule.thresholdUpper) && (number >= rule.thresholdLower)){
return true;
}
}
}
else if (rule.thresholdUpper != "none"){
if (!rule.eqUpper) {
if(number < rule.thresholdUpper){
return true;
}
}
else{
if(number <= rule.thresholdUpper){
return true;
}
}
}
else if (rule.thresholdLower != "none"){
if (!rule.eqLower) {
if(number > rule.thresholdLower){
return true;
}
}
else{
if(number >= rule.thresholdLower){
return true;
}
}
}return false;
}
};
window.removeFromArray = function(arr, val) {
for (var i = 0; i < arr.length; i++)
if (val == arr[i])
return arr.splice(i,1);
return null;
};
window.milkAmount = function(slave) {
var milk;
var calcs;
if (!slave) {
return null;
} else {
calcs = slave.boobs-slave.boobsImplant
if (calcs > 20000) {
milk = (118+((calcs-20000)/400))
} else if (calcs > 10000) {
milk = (78+((calcs-10000)/300))
} else if (calcs > 5000) {
milk = (53+((calcs-5000)/200))
} else if (calcs > 2000) {
milk = (29+((calcs-2000)/125))
} else if (calcs > 800) {
milk = (16+((calcs-800)/80))
} else {
milk = (8+((calcs-400)/50))
}
if (slave.lactation == 2) {
milk *= 1.2
}
milk += (milk*((slave.devotion-50)/200))
if (slave.boobsImplant > 200) {
milk *= 0.9
}
calcs = slave.hormones
if (slave.balls != 0 && calcs > -2) {
calcs -= 1
} else if (slave.ovaries != 1 && calcs < 2) {
calcs += 1
}
milk *= (1+(calcs*0.1))
milk *= (1+(slave.preg/100))
milk *= (1+(slave.health/50))
milk *= (1+(slave.weight/500))
milk *= (1+(slave.lactationAdaptation/500))
milk = Math.trunc(milk)
milk = Math.clamp(milk,1,1000000000000000000)
return milk
}
};
window.cumAmount = function(slave) {
var cum = 0;
var calcs = 0;
if (!slave) {
return null;
} else {
if (slave.drugs == "testicle enhancement") {
cum = ((slave.balls*3.5)+random(0,2))
} else if (slave.drugs == "hyper testicle enhancement") {
cum = ((slave.balls*5)+random(0,2))
} else {
cum = ((slave.balls*2.5)+random(0,2))
}
if (slave.prostateImplant == 1) {
cum *= 1.2
}
if (slave.diet == "cum production") {
cum *= 1.2
}
calcs = slave.hormones
cum *= (1-(calcs*0.1))
if (slave.scrotum == 0) {
cum *= 0.8
}
if (slave.devotion > 50) {
cum += (cum*(slave.devotion/100))
} else if (slave.devotion < -50) {
cum += (cum*(slave.devotion/100))
}
if (slave.health > 50) {
cum += (cum*(slave.health/50))
} else if (slave.health < -50) {
cum += (cum*(slave.health/50))
}
cum = Math.trunc(cum)
cum = Math.clamp(cum,1,1000000000000000000)
return cum
}
};
window.randomRelatedSlave = function(slave, filterFunction) {
if(!slave || !SugarCube) { return undefined; }
if(typeof filterFunction !== 'function') { filterFunction = function(s, index, array) { return true; }; }
return SugarCube.State.variables.slaves.filter(filterFunction).shuffle().find(function(s, index, array) {return areSisters(slave, s) || s.mother == slave.ID || s.father == slave.ID || slave.ID == s.mother || slave.ID == s.father; })
}
window.randomRelatedAvailableSlave = function(slave) {
return randomRelatedSlave(slave, function(s, index, array) { return isSlaveAvailable(s); });
}
window.randomSister = function(slave) {
return randomRelatedSlave(slave, function(s, index, array) { return areSisters(slave, s); });
}
window.randomAvailableSister = function(slave) {
return randomRelatedSlave(slave, function(s, index, array) { return isSlaveAvailable(s) && areSisters(slave, s); });
}
window.randomDaughter = function(slave) {
return randomRelatedSlave(slave, function(s, index, array) { return s.mother == slave.ID || s.father == slave.ID; });
}
window.randomAvailableDaughter = function(slave) {
return randomRelatedSlave(slave, function(s, index, array) { return isSlaveAvailable(s) && (s.mother == slave.ID || s.father == slave.ID); });
}
window.randomParent = function(slave) {
return randomRelatedSlave(slave, function(s, index, array) { return s.ID == slave.mother || s.ID == slave.father; });
}
window.randomAvailableParent = function(slave) {
return randomRelatedSlave(slave, function(s, index, array) { return isSlaveAvailable(s) && (s.ID == slave.mother || s.ID == slave.father); });
}
window.totalPlayerRelatives = function(pc) {
var relatives = 0;
if (pc.mother > 0) {
relatives += 1
}
if (pc.father > 0) {
relatives += 1
}
if (pc.daughters > 0) {
relatives += pc.daughters
}
if (pc.sisters > 0) {
relatives += pc.sisters
}
return relatives
};
window.ngUpdateGenePool = function(genePool) {
var transferredSlaveIds = (SugarCube.State.variables.slaves || [])
.filter(function(s) { return s.ID >= 1200000; })
.map(function(s) { return s.ID - 1200000; });
return (genePool || [])
.filter(function(s) { return transferredSlaveIds.indexOf(s.ID) >= 0; })
.map(function(s) {
var result = jQuery.extend(true, {}, s);
result.ID += 1200000;
return result;
});
}
|
r3d/fc
|
src/js/storyJS.tw
|
tw
|
bsd-3-clause
| 53,940
|
:: UtilJS [script]
if(!Array.prototype.findIndex) {
Array.prototype.findIndex = function(predicate) {
if (this == null) {
throw new TypeError('Array.prototype.find called on null or undefined');
}
if (typeof predicate !== 'function') {
throw new TypeError('predicate must be a function');
}
var list = Object(this);
var length = list.length >>> 0;
var thisArg = arguments[1];
var value;
for (var i = 0; i < length; i++) {
value = list[i];
if (predicate.call(thisArg, value, i, list)) {
return i;
}
}
return -1;
};
};
/*
A categorizer is used to "slice" a value range into distinct categories in an efficient manner.
--- Example ---
Original SugarCube code
<<if _Slave.muscles > 95>>
Musc++
<<elseif _Slave.muscles > 30>>
Musc+
<<elseif _Slave.muscles > 5>>
Toned
<<elseif _Slave.muscles > -6>>
<<elseif _Slave.muscles > -31>>
@@color:red;weak@@
<<elseif _Slave.muscles > -96>>
@@color:red;weak+@@
<<else>>
@@color:red;weak++@@
<</if>>
As a categorizer
<<if ndef $cats>><<set $cats = {}>><</if>>
<<if ndef $cats.muscleCat>>
<!-- This only gets set once, skipping much of the code evaluation, and can be set outside of the code in an "init" passage for further optimization -->
<<set $cats.muscleCat = new Categorizer([96, 'Musc++'], [31, 'Musc+'], [6, 'Toned'], [-5, ''], [-30, '@@color:red;weak@@'], [-95, '@@color:red;weak+@@'], [-Infinity, '@@color:red;weak++@@'])>>
<</if>>
<<print $cats.muscleCat.cat(_Slave.muscles)>>
*/
window.Categorizer = function() {
this.cats = Array.prototype.slice.call(arguments)
.filter(function(e, i, a) {
return e instanceof Array && e.length == 2 && typeof e[0] === 'number' && !isNaN(e[0])
&& a.findIndex(function(val) { return e[0] === val[0]; }) === i; /* uniqueness test */ })
.sort(function(a, b) { return b[0] - a[0]; /* reverse sort */ });
};
window.Categorizer.prototype.cat = function(val, def) {
if(typeof val !== 'number' || isNaN(val)) {
return def;
}
var result = this.cats.find(function(e) { return val >= e[0]; });
return result ? result[1] : def;
};
|
r3d/fc
|
src/js/utilJS.tw
|
tw
|
bsd-3-clause
| 2,074
|
:: Abort
<<set $nextButton to "Back">>\
<<set $nextLink to "Slave Interact">>\
<<nobr>>
The remote surgery makes aborting a pregnancy quick and efficient. $activeSlave.slaveName is
<<if $activeSlave.fetish is "pregnancy">>
@@color:red;fundamentally broken.@@ Her entire concept of self and sexuality was wrapped up in the life growing within her, and now it is gone.
<<set $activeSlave.fetish to "mindbroken">>
<<elseif $activeSlave.devotion < -50>>
@@color:mediumorchid;filled with violent, consuming hatred@@. Even though she knew her baby was destined for a slave orphanage, it seems she cared for it and views you as its killer. She is @@color:gold;terrified of your power@@ over her body.
<<set $activeSlave.trust -= 10>>
<<set $activeSlave.devotion -= 25>>
<<elseif $activeSlave.devotion < -20>>
@@color:mediumorchid;afflicted by desperate, inconsolable sobbing@@. Even though she knew her baby was destined for a slave orphanage, it seems she cared for it. She is @@color:gold;terrified of your power@@ over her body.
<<set $activeSlave.trust -= 10>>
<<set $activeSlave.devotion -= 10>>
<<elseif $activeSlave.devotion <= 20>>
@@color:mediumorchid;consumed by muted weeping and enduring sorrow@@. Even though she knew her baby was destined for a slave orphanage, it seems she cared for it. She is @@color:gold;terrified of your power@@ over her body.
<<set $activeSlave.trust -= 10>>
<<set $activeSlave.devotion -= 5>>
<<elseif $activeSlave.devotion <= 50>>
dully obedient. She has been broken to slave life so thoroughly that even this is neither surprising nor affecting. She is @@color:gold;terrified of your power@@ over her body.
<<set $activeSlave.trust -= 10>>
<<else>>
@@color:hotpink;pleased by this stark development@@, since she is so attentive to your will. She also expects she'll be able to fuck better now.
<<set $activeSlave.devotion += 4>>
<</if>>
<<set _currentRule to lastPregRule($activeSlave,$defaultRules)>>
<<if ($activeSlave.assignmentVisible == 1) && (_currentRule != null)>><<set $activeSlave.preg to -1>><<else>><<set $activeSlave.preg to 0>><</if>>
<<if $activeSlave.reservedChildren > 0>>
<<set $reservedChildren -= $activeSlave.reservedChildren>>
<</if>>
<<set $activeSlave.pregType = 0>>
<<set $activeSlave.pregSource = 0>>
<</nobr>>
|
r3d/fc
|
src/npc/abort.tw
|
tw
|
bsd-3-clause
| 2,299
|
:: Acquisition [nobr]
<<if $saveImported == 1>><<set _valueOwed to 5000>><<else>><<set _valueOwed to 50000>><</if>>
<<if $freshPC == 1>>
<<if $PC.vagina == 1>>
<<set $PC.births = 0>>
<<if $PC.career == "servant">>
<<if $PC.actualAge >= 50 >>
<<set $PC.births = 9>>
<<set $PC.birthMaster = 9>>
<<elseif $PC.actualAge >= 35>>
<<set $PC.births = 6>>
<<set $PC.birthMaster = 6>>
<<else>>
<<set $PC.births = 3>>
<<set $PC.birthMaster = 3>>
<</if>>
<<for $i to 0; $i < $slaves.length; $i++>>
<<if $slaves[$i].origin == "She was another of your late master's servants. She spent nine months in your womb, courtesy of your master." ||$slaves[$i].origin == "Your late master took pleasure in using his servants in creative ways. He inseminated you with your own sperm, and nine months later, your daughter was born.">>
<<set $PC.births += 1>>
<<set $PC.birthMaster += 1>>
<</if>>
<</for>>
<<elseif $PC.career == "escort">>
<<for $i to 0; $i < $slaves.length; $i++>>
<<if $slaves[$i].origin == "She was the result of unprotected sex with a client. He paid you quite well to enjoy your body as you grew heavy with his child." || $slaves[$i].origin == "A client payed you a large sum of credits to prove you could literally fuck yourself. She is the result of that lucrative night.">>
<<set $PC.births += 1>>
<<set $PC.birthClient += 1>>
<</if>>
<</for>>
<<else>>
<<for $i to 0; $i < $slaves.length; $i++>>
<<if $slaves[$i].mother == -1>>
<<set $PC.births += 1>>
<<set $PC.birthOther += 1>>
<</if>>
<</for>>
<</if>>
<<if $PC.preg > 0>>
<<if $PC.career == "servant">>
<<set $PC.pregSource = -3>>
<<elseif $PC.career == "escort">>
<<set $PC.pregSource = -2>>
<</if>>
<</if>>
<<else>> /*testtest*/
<<set $PC.pregSource = 0>>
<<set $PC.mother = 0>>
<<set $PC.mother = 0>>
<<set $PC.sisters = 0>>
<<set $PC.daughters = 0>>
/*Reserved for player-family setting, unsetting, etc. */
<</if>>
<</if>> /*closes ng*/
You've done it.
<br><br>
You arrive at your new arcology, $arcologies[0].name, and head straight to the penthouse to enter the access codes that will tell the $arcologies[0].name systems to recognize you as their owner. The penthouse office is ready to receive the codes, and they authenticate. A voice activates in your earpiece.
<br><br>
//Congratulations. I am a personal assistant program, and it is my pleasure to assist you, $PCName, the new owner of $arcologies[0].name. I will offer useful information whenever possible in italics. Your new arcology has some unusual equipment. The previous owner kept a small stable of sex slaves. The penthouse therefore has a body modification studio for tattooing, bleaching and piercing, and an auto salon for more prosaic things like hair care. It also has a remote surgery, a small surgical theater that can be operated remotely by a qualified surgeon if you can pay the fee. Finally, it has a slave nutrition system connected to the arcology's hydroponics bays. This system produces a tasty protein-rich drink that provides the physically active female body all its necessary nutrients while leaving the lower digestive tract extremely clean. It even causes a mild increase in sex drive.
<br><br>
The previous owner seems to have left in something of a hurry.
<<if $cheatMode == 1>>
Since you've elected to take over an arcology with special advantages, you've acquired a very special group of slaves.
<<elseif $saveImported == 1>>
Since it took some time for you to ensure that your existing stable of slaves were safely moved to $arcologies[0].name, the previous owner had the time to get most of their things away.
<<elseif ($targetArcology.type != "New") && ($targetArcology.type != "Multiculturalist")>>
<<switch $targetArcology.type>>
<<case "Supremacist">>
They kept a personal stable of fearful $arcologies[0].FSSupremacistRace sex slaves, but their sexual training is incomplete. Several of them are still here.
<<case "Subjugationist">>
They made it a special goal to enslave and whore out as many $arcologies[0].FSSubjugationistRace people as possible. Several of them are still here.
<<case "GenderRadicalist">>
They were in the process of building a stable of pretty young shemale whores. Several of them are still here. They're are all very attracted to men, and skilled at pleasing them.
<<case "GenderFundamentalist">>
They kept a personal stable of slaves for breeding purposes. Several of them are still here. They've been kept pregnant, and work as servants when they aren't being bred.
<<case "Paternalist">>
Their slaves were all very well treated. Several of them are still here. They were allowed to work as maids, and weren't even forced to have sex.
<<case "Degradationist">>
Their personal slaves were all Fuckdolls, slaves who have been permanently encased in advanced latex suits and converted into living sex toys. Several of them are still here.
<<case "AssetExpansionist">>
They kept a collection of bejeweled boobs for company, but they focused on breast expansion to the exclusion the slaves' emotional training. Several of them are still here.
<<case "SlimnessEnthusiast">>
They kept a harem of slim, pretty girls, and treated them very well. Several of them are still here. They should be very trusting of a new owner.
<<case "TransformationFetishist">>
They were just putting the finishing touches on a planned brothel's worth of surgically enhanced whores. Several of them are still here. They are already used to prostitution.
<<case "BodyPurist">>
Their slaves were trained for sexual use, but their health, fitness, and natural appearance were the main priorities. Several of them are still here.
<<case "MaturityPreferentialist">>
They preferred to keep their MILFs as scantily clad servants. Several of them are still here. They aren't all happy to be sex objects, but they're used to it.
<<case "YouthPreferentialist">>
They treated their young slaves very well. Several of them are still here. Virgins have been carefully preserved, but have learned to use their mouths through experience.
<<case "Pastoralist">>
Their herd of cow girls was progressing nicely, though more progress had been made on milk production than on training. Several of them are still here.
<<case "PhysicalIdealist">>
Their slaves worked as prostitutes, but mostly to fund a program of muscle building for all of them, which was nearing completion. Several of them are still here.
<<case "ChattelReligionist">>
They were recruiting a stable of slave whores by targeting people with religious complexes that made them particularly vulnerable to recruitment. Several of them are still here.
<<case "RomanRevivalist">>
The only one of their slaves left is the bodyguard. She should be very willing to transfer her loyalty to you, as her new owner.
<<case "EgyptianRevivalist">>
They kept a harem of beautiful slave girls, who have been well-treated and well-trained. They should be very willing to serve you in turn.
<<case "EdoRevivalist">>
They put considerable effort into creating modern slave geisha, elegant Japanese slaves who were assigned to serve the public. Several of them are still here.
<<case "ArabianRevivalist">>
They trained slaves personally, and never kept slaves for very long. The slaves they left are all partway through being trained.
<<case "ChineseRevivalist">>
The only one of their slaves left is the Head Girl. She should be willing to transfer her loyalty to you, as her proper superior.
<<case "Eugenics">>
The only one of their slaves left is an absolute beauty of a girl. She is too smart for her own good and will likely not trust you.
<<case "Repopulationist">>
They kept a personal stable of slaves for breeding purposes. Several of them are still here. They've been kept heavily pregnant, and are used to being used whilst so.
<<default>>
ERROR: bad arcology type
<</switch>>
<<else>>
They could not get all of their personal effects away. Since they <<if $targetArcology.type == "Multiculturalist">>tried to sample different kinds of sexual slavery<<else>>did not have the time in control of the arcology to develop a specific stable of sex slaves<</if>>, their slaves were quite varied.
<</if>>
<<set $heroSlaves to $heroSlaves.shuffle()>>
<<set _valueGiven to 0>>
<<if $ageMode == 1>>
<<include [[Aging Test]]>>
<<elseif $cheatMode == 1>>
<<include [[Cheatmode Database]]>>
<<elseif $saveImported == 1>>
<<elseif ($targetArcology.type != "New") && ($targetArcology.type != "Multiculturalist")>>
<<for $j to 0; $j < 5; $j++>>
<<if _valueOwed - _valueGiven <= 5000>><<break>><</if>>
<<switch $targetArcology.type>>
<<case "Supremacist">>
<<set $arcologies[0].FSSupremacistLawME = 1>><<include "Generate New Slave">><<set $arcologies[0].FSSupremacistLawME = 0>>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(0,15)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.entertainSkill = random(15,35)>>
<<set $activeSlave.clothes = "uncomfortable straps", $activeSlave.collar = "uncomfortable leather", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "please you">>
<<case "Subjugationist">>
<<set $fixedRace = $activeArcology.FSSubjugationistRace>><<include "Generate New Slave">><<set $fixedRace = 0>>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(0,15)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.whoreSkill = random(15,35)>>
<<set $activeSlave.clothes = "uncomfortable straps", $activeSlave.collar = "uncomfortable leather", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "whore">>
<<case "GenderRadicalist">>
<<set $activeSlaveOneTimeMaxAge to 25>>
<<include "Generate XY Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(15,-15), $activeSlave.health = 100>>
<<set $activeSlave.face = random(0,2)>>
<<set $activeSlave.boobs += 100*random(2,4)>>
<<set $activeSlave.butt += random(1,2)>>
<<set $activeSlave.attrXY = random(70,90), $activeSlave.attrXX = 0>>
<<set $activeSlave.oralSkill = random(35,65), $activeSlave.analSkill = random(35,65), $activeSlave.whoreSkill = random(35,65)>>
<<SoftenSexualFlaw $activeSlave>>
<<set $activeSlave.clothes = "uncomfortable straps", $activeSlave.collar = "stylish leather", $activeSlave.shoes = "heels">>
<<set $activeSlave.assignment = "whore">>
<<case "GenderFundamentalist">>
<<set $activeSlaveOneTimeMinAge to $fertilityAge>>
<<set $activeSlaveOneTimeMaxAge to 25>>
<<include "Generate XX Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(55,65)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.preg = random(1,35), $activeSlave.lactation = 1>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.clothes = "a nice maid outfit", $activeSlave.collar = "tight steel", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "work as a servant">>
<<case "Paternalist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(55,65), $activeSlave.health = random(55,65)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.intelligence = random(1,3), $activeSlave.intelligenceImplant = 1>>
<<set $activeSlave.entertainSkill = random(15,35)>>
<<set $activeSlave.clothes = "conservative clothing", $activeSlave.collar = "none", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "work as a servant">>
<<case "Degradationist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = 25, $activeSlave.trust = -25, $activeSlave.health = random(0,15)>>
<<set $activeSlave.fuckdoll = 100>>
<<set $activeSlave.career = "a Fuckdoll">>
<<set $activeSlave.fetish = "mindbroken">>
<<set $activeSlave.boobs += 100*random(10,20)>>
<<set $activeSlave.butt += random(2,3)>>
<<set $activeSlave.lips = random(2,4)>>
<<set $activeSlave.weight = random(-15,15)>>
<<set $activeSlave.oralSkill = 0, $activeSlave.analSkill = 0, $activeSlave.vaginalSkill = 0, $activeSlave.entertainSkill = 0, $activeSlave.whoreSkill = 0>>
<<set $activeSlave.behavioralFlaw = "none", $activeSlave.sexualFlaw = "none">>
<<set $activeSlave.clothes == "a Fuckdoll suit">>
<<set $activeSlave.assignment = "please you">>
<<case "AssetExpansionist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-15,15), $activeSlave.health = random(25,45)>>
<<set $activeSlave.chem = 50>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.boobs += 100*random(10,20)>>
<<set $activeSlave.butt += random(2,3)>>
<<set $activeSlave.lips += random(0,1)>>
<<if $activeSlave.balls > 0>><<set $activeSlave.balls++>><</if>>
<<if $activeSlave.dick > 0>><<set $activeSlave.dick++>><</if>>
<<set $activeSlave.weight = random(15,90)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = 0, $activeSlave.anus = 0>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.entertainSkill = random(15,35)>>
<<set $activeSlave.clothes = "slutty jewelry", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
<<set $activeSlave.assignment = "please you">>
<<case "SlimnessEnthusiast">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(55,65), $activeSlave.health = random(55,65)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.boobs = 100*random(1,4)>>
<<set $activeSlave.butt = random(1,2)>>
<<set $activeSlave.weight = random(-25,-15)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = 0, $activeSlave.anus = 0>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.entertainSkill = random(15,35)>>
<<set $activeSlave.clothes = "a leotard", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "please you">>
<<case "TransformationFetishist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-15,15), $activeSlave.health = random(-15,0)>>
<<set $activeSlave.faceImplant = random(1,2)>>
<<set $activeSlave.face = Math.trunc($activeSlave.face+$activeSlave.faceImplant,-3,3)>>
<<set $activeSlave.boobsImplant = 200*random(4,8)>>
<<set $activeSlave.boobs += $activeSlave.boobsImplant>>
<<set $activeSlave.buttImplant = random(2,4)>>
<<set $activeSlave.butt += $activeSlave.buttImplant>>
<<set $activeSlave.lipsImplant = random(1,2)>>
<<set $activeSlave.lips = Math.trunc($activeSlave.lipsImplant+2,-3,3)>>
<<set $activeSlave.weight = random(-25,-15)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.clothes = "a string bikini", $activeSlave.collar = "shock punishment", $activeSlave.shoes = "extreme heels">>
<<set $activeSlave.assignment = "whore">>
<<case "BodyPurist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(25,45), $activeSlave.health = 100>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.weight = random(-5,5)>>
<<set $activeSlave.muscle = random(10,25)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.clothes = "a nice maid outfit", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
<<set $activeSlave.assignment = "work as a servant">>
<<case "MaturityPreferentialist">>
<<set $activeSlaveOneTimeMinAge to 36>>
<<set $activeSlaveOneTimeMaxAge to 39>>
<<set $one_time_age_overrides_pedo_mode to 1>>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(-15,15), $activeSlave.health = random(25,45)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.boobs += 100*random(1,4)>>
<<set $activeSlave.butt += random(1,2)>>
<<set $activeSlave.weight = random(-5,90)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<SoftenBehavioralFlaw $activeSlave>>
<<set $activeSlave.clothes = "a slutty maid outfit", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
<<set $activeSlave.assignment = "work as a servant">>
<<case "YouthPreferentialist">>
<<set $activeSlaveOneTimeMaxAge to 19>>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(55,65), $activeSlave.health = random(25,45)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.boobs = 100*random(1,4)>>
<<set $activeSlave.butt = random(1,3)>>
<<set $activeSlave.weight = random(-25,25)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = 0, $activeSlave.anus = 0>>
<<if $activeSlave.vagina > -1>><<set $activeSlave.vaginalSkill = 0, $activeSlave.vagina = 0>><</if>>
<<set $activeSlave.entertainSkill = random(15,35)>>
<<set $activeSlave.clothes = "a schoolgirl outfit", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
<<set $activeSlave.assignment = "work as a servant">>
<<case "Pastoralist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(25,45)>>
<<set $activeSlave.boobs += 100*random(10,20)>>
<<if $activeSlave.balls > 0>><<set $activeSlave.balls++>><</if>>
<<set $activeSlave.lactation = 2>>
<<set $activeSlave.clothes = "Western clothing", $activeSlave.collar = "leather with cowbell", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "get milked">>
<<case "PhysicalIdealist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(25,45), $activeSlave.health = 100>>
<<set $activeSlave.muscles = random(50,100)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.whoreSkill = random(15,35)>>
<<set $activeSlave.clothes = "body oil", $activeSlave.collar = "none", $activeSlave.shoes = "none">>
<<set $activeSlave.assignment = "whore">>
<<case "ChattelReligionist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(55,65), $activeSlave.health = random(0,15)>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.whoreSkill = random(10,20)>>
<<set $activeSlave.behavioralFlaw = "none", $activeSlave.behavioralQuirk = "sinful">>
<<set $activeSlave.clothes = "a chattel habit", $activeSlave.collar = "heavy gold", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "whore">>
<<case "RomanRevivalist">>
<<set $activeSlaveOneTimeMaxAge to 19>>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = 100, $activeSlave.trust = random(55,65), $activeSlave.health = 100>>
<<set $activeSlave.face = random(0,2)>>
<<set $activeSlave.muscles = random(25,50)>>
<<set $activeSlave.combatSkill = 1>>
<<set $activeSlave.behavioralFlaw = "none", $activeSlave.behavioralQuirk = "fitness">>
<<set $activeSlave.behavioralFlaw = "none">>
<<set $activeSlave.clothes = "a toga", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "guard you", $Bodyguard = $activeSlave>>
<<case "EgyptianRevivalist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(25,45), $activeSlave.health = random(25,45)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.oralSkill = random(15,35), $activeSlave.analSkill = random(15,35)>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.entertainSkill = random(15,35)>>
<<SoftenSexualFlaw $activeSlave>>
<<set $activeSlave.clothes = "slutty jewelry", $activeSlave.collar = "ancient Egyptian", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "please you">>
<<case "EdoRevivalist">>
<<set $fixedRace = "asian">><<include "Generate New Slave">><<set $fixedRace = 0>>
<<set $activeSlave.nationality = "Japanese">>
<<NationalityToName $activeSlave>>
<<set $activeSlave.accent = 0>>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(25,45), $activeSlave.health = random(25,45)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.intelligence = random(1,3), $activeSlave.intelligenceImplant = 1>>
<<set $activeSlave.entertainSkill = 100>>
<<set $activeSlave.clothes = "a kimono", $activeSlave.collar = "satin choker", $activeSlave.shoes = "heels">>
<<set $activeSlave.assignment = "serve the public">>
<<case "ArabianRevivalist">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-15,15), $activeSlave.health = random(25,45)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.intelligence = random(0,2), $activeSlave.intelligenceImplant = 0>>
<<set $activeSlave.clothes = "harem gauze", $activeSlave.collar = "uncomfortable leather", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "take classes">>
<<case "ChineseRevivalist">>
<<set $activeSlaveOneTimeMinAge to 36>>
<<set $activeSlaveOneTimeMaxAge to 38>>
<<set $one_time_age_overrides_pedo_mode to 1>>
<<set $fixedRace = "asian">><<include "Generate New Slave">><<set $fixedRace = 0>>
<<set $activeSlave.nationality = "Chinese">>
<<NationalityToName $activeSlave>>
<<NationalityToAccent $activeSlave>>
<<set $activeSlave.devotion = random(55,65), $activeSlave.trust = random(25,45), $activeSlave.health = random(25,45)>>
<<set $activeSlave.face = random(0,2)>>
<<set $activeSlave.accent = 0>>
<<set $activeSlave.intelligence = 3, $activeSlave.intelligenceImplant = 1>>
<<set $activeSlave.oralSkill = 100, $activeSlave.analSkill = 100>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina == 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = 100>>
<</if>>
<<set $activeSlave.entertainSkill = 100, $activeSlave.whoreSkill = 100>>
<<SoftenBehavioralFlaw $activeSlave>>
<<SoftenSexualFlaw $activeSlave>>
<<set $activeSlave.clothes = "a slutty qipao", $activeSlave.collar = "pretty jewelry", $activeSlave.shoes = "heels">>
<<set $activeSlave.assignment = "be your Head Girl", $HeadGirl = $activeSlave>>
<<case "Eugenics">>
<<include "Generate New Slave">>
<<set $activeSlave.devotion = -100, $activeSlave.trust = -100, $activeSlave.health = random(80,90)>>
<<set $activeSlave.intelligence = 3>>
<<set $activeSlave.intelligenceImplant = 1>>
<<set $activeSlave.face = 3>>
<<set $activeSlave.faceShape = "sensual">>
<<set $activeSlave.oralSkill = random(35,75), $activeSlave.analSkill = random(35,75)>>
<<if $activeSlave.vagina > -1>>
<<if $activeSlave.vagina = 0>><<set $activeSlave.vagina++>><</if>>
<<set $activeSlave.vaginalSkill = random(35,75)>>
<</if>>
<<set $activeSlave.entertainSkill = random(15,35)>>
<<set $activeSlave.whoreSkill = 0>>
<<SoftenSexualFlaw $activeSlave>>
<<set $activeSlave.clothes = "a ball gown", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "rest">>
<<case "Repopulationist">>
<<set $activeSlaveOneTimeMinAge to $fertilityAge+3>>
<<set $activeSlaveOneTimeMaxAge to 25>>
<<set $one_time_age_overrides_pedo_mode to 1>>
<<include "Generate XX Slave">>
<<set $activeSlave.devotion = random(25,45), $activeSlave.trust = random(-25,-45), $activeSlave.health = random(55,65)>>
<<set $activeSlave.face = random(1,3)>>
<<set $activeSlave.preg = random(10,35),$activeSlave.pregType = random(3,5) , $activeSlave.lactation = 1>>
<<set $activeSlave.birthsTotal = 5>>
<<set $activeSlave.bellySag = 20>>
<<if $activeSlave.vagina > -1>>
<<set $activeSlave.vagina = 4>>
<<set $activeSlave.vaginalSkill = random(15,35)>>
<</if>>
<<set $activeSlave.clothes = "a nice maid outfit", $activeSlave.shoes = "flats">>
<<set $activeSlave.assignment = "please you">>
<<default>>
ERROR: bad arcology type
<</switch>>
<<set $activeSlave.origin = "You acquired her along with the arcology.", $activeSlave.career = "a slave">>
<<slaveCost $activeSlave>>
<<set _valueGiven += $slaveCost>>
<<AddSlave $activeSlave>>
<</for>>
<<else>>
<<for $j to 0; $j < $heroSlaves.length; $j++>>
<<if _valueOwed - _valueGiven <= 5000>>
<<break>>
<</if>>
<<set $activeSlave to $heroSlaves[$j]>>
<<set $dump to $heroSlaves.pluck($j,$j)>>
<<slaveCost $activeSlave>>
<<if _valueGiven + $slaveCost < _valueOwed*2>>
<<NationalityToAccent $activeSlave>>
<<set $activeSlave.pubicHColor to $activeSlave.hColor>>
<<set $activeSlave.pubicHStyle = "waxed">>
<<set $activeSlave.underArmHColor = $activeSlave.hColor>>
<<set $activeSlave.underArmHStyle = "waxed">>
<<set $activeSlave.oldDevotion to $activeSlave.devotion>>
<<set $activeSlave.oldTrust to $activeSlave.trust>>
<<set _valueGiven += $slaveCost>>
<<AddSlave $activeSlave>>
<<if $activeSlave.fetish is "mindbroken">>
$activeSlave.slaveName is, sadly, not mentally competent, and is wandering through the penthouse at the moment.
<<elseif $activeSlave.amp == 1>>
$activeSlave.slaveName is a quadruple amputee and is quite helpless, so you can attend to her at your leisure.
<<elseif $activeSlave.devotion < -50>>
$activeSlave.slaveName is quite rebellious and was attempting to escape, so I have locked her in the slave quarters.
<<elseif $activeSlave.devotion < -20>>
$activeSlave.slaveName resists my orders and was considering escape, so I have locked her in the slave quarters.
<<elseif $activeSlave.devotion <= 20>>
$activeSlave.slaveName is reasonably obedient, and is waiting for you in the dormitory, I believe in the hope of making a good impression.
<<elseif $activeSlave.energy > 95>>
$activeSlave.slaveName is a remarkable sexual addict, and I believe she will be very happy to meet you.
<<elseif $activeSlave.fetish is "pregnancy" && $activeSlave.preg > 10>>
$activeSlave.slaveName is currently in the dormitory masturbating over her growing pregnancy.
<<elseif $activeSlave.preg > 20>>
$activeSlave.slaveName is currently in the dormitory massaging her pregnant belly.
<<elseif $activeSlave.fetish is "buttslut">>
$activeSlave.slaveName is currently in the dormitory masturbating anally, and I believe she will be happy to meet you.
<<elseif $activeSlave.fetish is "cumslut">>
$activeSlave.slaveName is currently in the dormitory exhibiting oral fixation, and I believe she will be happy to meet you.
<<elseif $activeSlave.fetish is "boobs">>
$activeSlave.slaveName is currently in the dormitory playing with her nipples, and I believe she will be happy to meet you.
<<elseif $activeSlave.fetish is "pregnancy">>
$activeSlave.slaveName is currently in the dormitory examining herself to try to discern her fertility, and I believe she will be happy to meet you.
<<elseif $activeSlave.fetish is "humiliation">>
$activeSlave.slaveName is currently in the entryway flashing passersby, and I believe she will be happy to meet you.
<<elseif $activeSlave.fetish is "submissive">>
$activeSlave.slaveName is currently in the dormitory, experimenting with self-bondage using the sheets; I believe she will be happy to meet you.
<<elseif $activeSlave.fetish is "dom">>
$activeSlave.slaveName is currently in the exercise area keeping fit; she likes to take an active role sexually and is using this down time to work out.
<<elseif $activeSlave.fetish is "sadist">>
$activeSlave.slaveName is currently outside your office; she enjoys being superior to other slaves and I believe she means to ingratiate herself to you.
<<elseif $activeSlave.fetish is "masochist">>
$activeSlave.slaveName is a sexual masochist; she is currently in the bathroom, experimenting with auto-flagellation with a wet towel.
<<else>>
$activeSlave.slaveName is currently outside your office, and I believe she is attempting to maintain sexual arousal to make a good first impression on you.
<</if>>
<</if>>
<</for>>
<</if>>
<<if _valueOwed-_valueGiven > 0>>
There are some valuables present, worth ¤<<print _valueOwed-_valueGiven>>.
<<set $cash += _valueOwed-_valueGiven>>
<</if>>
//
/* RELATIONSHIP MUTUALITY CHECK, OLDMENTAL */
<<set $averageTrust = 0>>
<<set $averageDevotion = 0>>
<<set _slavesContributing = 0>>
<<for $i to 0; $i < $slaves.length; $i++>>
<<if $familyTesting == 1>>
<<set $slaves[$i].sisters = 0>>
<<set $slaves[$i].daughters = 0>>
<<for $j to 0; $j < $slaves.length; $j++>>
<<if $slaves[$j].mother == $slaves[$i].ID || $slaves[$j].father == $slaves[$i].ID>>
<<set $slaves[$i].daughters += 1>>
<</if>>
<<if areSisters($slaves[$j], $slaves[$i]) > 0>>
<<set $slaves[$i].sisters++>>
<</if>>
<</for>>
<</if>>
<<if $slaves[$i].relation != 0>>
<<set $seed to 0>>
<<for $j to 0; $j < $slaves.length; $j++>>
<<if $slaves[$i].relationTarget == $slaves[$j].ID>>
<<if $slaves[$j].relationTarget == $slaves[$i].ID>>
<<set $seed to 1>>
<<break>>
<</if>>
<</if>>
<</for>>
<<if $seed == 0>>
<<set $slaves[$i].relation to 0>>
<<set $slaves[$i].relationTarget to 0>>
<<goto "Acquisition">>
<</if>>
<</if>>
<<set $slaves[$i].oldDevotion to $slaves[$i].devotion>>
<<set $slaves[$i].oldTrust to $slaves[$i].trust>>
/* AVERAGE VALUES UPDATE */
<<if $slaves[$i].assignmentVisible == 1>>
<<set $averageTrust += $slaves[$i].trust, $averageDevotion += $slaves[$i].devotion, _slavesContributing += 1>>
<<else>>
<<if $slaves[$i].assignment != "be confined in the cellblock">>
<<if $slaves[$i].assignment != "be confined in the arcade">>
<<if ($slaves[$i].assignment != "work in the dairy") || ($dairyRestraintsSetting < 2)>>
<<set $averageTrust += $slaves[$i].trust*0.5, $averageDevotion += $slaves[$i].devotion*0.5, _slavesContributing += 0.5>>
<</if>>
<</if>>
<</if>>
<</if>>
<</for>>
<<set $averageTrust = $averageTrust/_slavesContributing>>
<<set $averageDevotion = $averageDevotion/_slavesContributing>>
<<set $enduringTrust = $averageTrust>>
<<set $enduringDevotion = $averageDevotion>>
<br><br>
<<link "Continue">>
<<set $ui = "main">>
<<set $fixedNationality to 0>>
<<if $terrain is "urban">>
<<set $minimumSlaveCost to 2000>>
<<set $slaveCostFactor to 0.7>>
<<elseif $terrain is "marine">>
<<set $minimumSlaveCost to 2500>>
<<set $slaveCostFactor to 1>>
<<else>>
<<set $minimumSlaveCost to 3000>>
<<set $slaveCostFactor to 1.3>>
<</if>>
<<script>>Save.autosave.save("Week Start Autosave")<</script>>
<<goto "Main">>
<</link>>
|
r3d/fc
|
src/npc/acquisition.tw
|
tw
|
bsd-3-clause
| 32,587
|
:: Agent Company [nobr]
<<set $nextButton to "Continue">>
<<set $nextLink to "AS Dump">>
<<set $returnTo = "Main">>
<<set $activeSlave.assignment = "live with your agent">>
<<set $activeSlave.assignmentVisible = 0>>
<<set $activeSlave.sentence = 0>>
<<if $activeSlave.rivalry > 0>>
<<for _i to 0;_i < $slaves.length;_i++>>
<<if $activeSlave.rivalryTarget == $slaves[_i].ID>>
<<set $slaves[_i].rivalry = 0>>
<<set $slaves[_i].rivalryTarget = 0>>
<</if>>
<</for>>
<<set $activeSlave.rivalry = 0>>
<<set $activeSlave.rivalryTarget = 0>>
<</if>>
<<if $activeSlave.ID is $HeadGirl.ID>>
<<set $HeadGirl to 0>>
<</if>>
<<if $activeSlave.ID is $Recruiter.ID>>
<<set $Recruiter to 0>>
<</if>>
<<if $activeSlave.ID is $Bodyguard.ID>>
<<set $Bodyguard to 0>>
<</if>>
<<for _i to 0;_i < $slaves.length;_i++>>
<<if $activeSlave.relationshipTarget == $slaves[_i].ID>>
<<set $subSlave = $slaves[_i]>>
<</if>>
<</for>>
<<for _i to 0;_i < $arcologies.length;_i++>>
<<if $subSlave.ID == $arcologies[_i].leaderID>>
<<set $activeArcology = $arcologies[_i]>>
<</if>>
<</for>>
<<SlaveTitle $activeSlave>>
Working in $activeArcology.name's penthouse office, $subSlave.slaveName gets a video call from you. Naturally, her personal assistant program has been instructed to give these the highest priority, and your face appears in front of her immediately. She greets you properly, and asks you what she can do to serve you. You tell her you're planning to send one of your slaves over to her arcology to assist her. Exchanges of this kind are neither unusual nor particularly interesting, so a slight look of perplexity clouds $subSlave.slaveName's face as she wonders why this merits a personal call. Normally, <<if $HeadGirl != 0>>$HeadGirl.slaveName<<else>>$assistantName<</if>> would handle it with her directly.
<br><br>
Her question is answered when you bring $activeSlave.slaveName in close, putting her in $subSlave.slaveName's view. $subSlave.slaveName's $subSlave.eyeColor eyes fly open with pleased surprise, but before she can speak, $activeSlave.slaveName goes first.
<<if canTalk($activeSlave) == false>>
Unable to speak herself, she simply makes a heart shape with her hands in view of the video call, and blows her <<if $activeSlave.relationship == 4>>lover<<else>>wife<</if>> a kiss.
<<elseif SlaveStatsChecker.checkForLisp($activeSlave)>>
"Hi <<if $activeSlave.relationship == 4>>lover<<else>>thweetheart<</if>>," she lisps in a syrupy tone. "Mith me?"
<<else>>
"Hi <<if $activeSlave.relationship == 4>>lover<<else>>sweetheart<</if>>," she says in a syrupy tone. "Miss me?"
<</if>>
<br><br>
$subSlave.slaveName smiles back at her, glowing with pleasure, and responds with exaggerated arousal.
<<switch $subSlave.fetish>>
<<case "submissive">>
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
"Looking forward to thleeping in your armth, babe,"
<<else>>
"Looking forward to sleeping in your arms, babe,"
<</if>>
the submissive
<<case "cumslut">>
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
"Can't wait to kith you, babe,"
<<else>>
"Can't wait to kiss you, babe,"
<</if>>
the orally fixated
<<case "humiliation">>
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
"Can't wait to take you right in the middle of the platha, here,"
<<else>>
"Can't wait to take you right in the middle of the plaza, here,"
<</if>>
the exhibitionist
<<case "buttslut">>
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
"I can't wait to fuck you in your hot little butt,"
<<else>>
"I can't wait to fuck you in your hot little ass,"
<</if>>
the anally fixated
<<case "boobs">>
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
"Looking forward to feeling your breathth again,"
<<else>>
"Looking forward to feeling your breasts again,"
<</if>>
the boob-loving
<<case "pregnancy">>
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
"Can't wait to share all the pregnant girlth here with you,"
<<else>>
"Can't wait to share all the pregnant girls here with you,"
<</if>>
the impregnation fetishist
<<case "dom">>
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
"Looking forward to shoving you fathedown, bitch,"
<<else>>
"Looking forward to shoving you facedown, bitch,"
<</if>>
the dominant
<<case "sadist">>
"Looking forward to making you bite the pillow again, bitch," the sadistic
<<case "masochist">>
"Can't wait to feel you hurt me again, babe," the masochistic
<<default>>
"Babe, I can't wait to give you a hug and tell you about $activeArcology.name," the loving
<</switch>>
leader of an entire arcology says.
|
r3d/fc
|
src/npc/agent/agentCompany.tw
|
tw
|
bsd-3-clause
| 4,614
|
:: Agent Retrieve [nobr]
<<silently>>
<<for $i to 0; $i < $slaves.length; $i++>>
<<if $slaves[$i].ID == $activeArcology.leaderID>>
<<for $j to 0; $j < $slaves.length; $j++>>
<<if $slaves[$j].assignment == "live with your agent">>
<<if $slaves[$j].ID == $slaves[$i].relationshipTarget>>
<<set $slaves[$j].assignment = "rest">>
<<set $slaves[$j].assignmentVisible = 1>>
<<set $slaves[$j].sentence = 0>>
<<break>>
<</if>>
<</if>>
<</for>>
<<if $slaves[$i].preg > 35>>
<<set $slaves[$i].birthsTotal += $slaves[$i].pregType>>
<<set $slaves[$i].preg = 0>>
<<set $slaves[$i].pregSource = 0>>
<<set $slaves[$i].pregType = 0>>
<</if>>
<<set $slaves[$i].assignment = "rest">>
<<set $slaves[$i].assignmentVisible = 1>>
<<set $slaves[$i].sentence = 0>>
<<break>>
<</if>>
<</for>>
<<set $activeArcology.leaderID = 0>>
<<set $activeArcology.government = "your trustees">>
<<for _i to 0;_i < $leaders.length;_i++>>
<<if $activeArcology.leaderID == $leaders[_i].ID>>
<<set $dump to $leaders.pluck([_i], [_i])>>
<<break>>
<</if>>
<</for>>
<<goto "Neighbor Interact">>
<</silently>>
|
r3d/fc
|
src/npc/agent/agentRetrieve.tw
|
tw
|
bsd-3-clause
| 1,101
|
:: Agent Select
<<set $nextButton to "Back">>
<<set $nextLink to "Neighbor Interact">>
<<set $showEncyclopedia to 1>><<set $encyclopedia to "Agents">>
''Appoint an Agent from your devoted slaves:''
<<include "Slave Summary">>
|
r3d/fc
|
src/npc/agent/agentSelect.tw
|
tw
|
bsd-3-clause
| 227
|
:: Agent Workaround [nobr]
<<set $nextButton to "Continue">>
<<set $nextLink to "AS Dump">>
<<set $returnTo = "Neighbor Interact">>
<<set $activeSlave.assignment = "be your agent">>
<<set $activeSlave.assignmentVisible = 0>>
<<set $activeSlave.sentence = 0>>
<<if $activeSlave.reservedChildren > 0>>
<<set $reservedChildren -= $activeSlave.reservedChildren>>
<<set $activeSlave.reservedChildren = 0>>
<</if>>
<<if $activeSlave.relationship <= 3>>
<<if $activeSlave.relationship > 0>>
<<for _i to 0;_i < $slaves.length;_i++>>
<<if $activeSlave.relationshipTarget == $slaves[_i].ID>>
<<set $slaves[_i].relationship = 0>>
<<set $slaves[_i].relationshipTarget = 0>>
<</if>>
<</for>>
<<set $activeSlave.relationship = 0>>
<<set $activeSlave.relationshipTarget = 0>>
<</if>>
<</if>>
<<if $activeSlave.rivalry > 0>>
<<for _i to 0;_i < $slaves.length;_i++>>
<<if $activeSlave.rivalryTarget == $slaves[_i].ID>>
<<set $slaves[_i].rivalry = 0>>
<<set $slaves[_i].rivalryTarget = 0>>
<</if>>
<</for>>
<<set $activeSlave.rivalry = 0>>
<<set $activeSlave.rivalryTarget = 0>>
<</if>>
<<set $leaders.push($activeSlave)>>
<<set $activeArcology.leaderID = $activeSlave.ID>>
<<set $activeArcology.government = "your agent">>
<<SlaveTitle $activeSlave>>
You order $activeSlave.slaveName to come into your office for orders. The devoted $desc has no prior warning that this is anything unusual, and from the <<if $activeSlave.energy > 95>>horny glint<<else>>glow of sexual availability<</if>> in her $activeSlave.eyeColor eyes as she <<if canWalk($activeSlave)>>enters<<else>>is helped in<</if>>, she <<if $activeSlave.energy > 95>>seems to be hoping<<else>>wouldn't mind hearing<</if>> that you've called her in for a quick fuck. In fact, the matter at hand is about as far as it could possibly be from that, on the spectrum of interactions between <<if $PC.title != 0>>master<<else>>mistress<</if>> and slave.
<br><br>
You offer her, without preamble, agency on your behalf in $activeArcology.name. As a woman of intelligence, she knows the basics of such an arrangement, but she's stunned into silence by the offer, so you outline it briefly. Having a slave lead an arcology would be too much, even for the most open minded of Free Cities societies. So, she would be freed, albeit subject to a set of private, restrictive contracts that would allow you to recall her if you wish, and require her to follow your directions, if you give her any. But other than that, she would be the effective leader of an entire arcology. It's an unusual arrangement, but one that's becoming more common as multiple arcologies come under united control.
<br><br>
She's intelligent and confident of her place within society as a valued slave, and knows that with your resources behind her, this is likely something she's capable of succeeding at. Nevertheless, her feelings are obviously mixed. It will be a challenge,
<<switch $HeadGirl.fetish>>
<<case "submissive">>
especially for a sexual submissive like her.
<<case "cumslut">>
and she'll have to find dominant ways to sate her oral appetites.
<<case "humiliation">>
especially for a humiliation addict like her.
<<case "buttslut">>
though she'll probably be able to live her anal life vicariously by buttfucking others.
<<case "boobs">>
but she'll have a practically infinite procession of breasts to judge and fondle.
<<case "pregnancy">>
but the potential for impregnation of hundreds of slaves excites her.
<<case "dom">>
but the prospect of having more slaves at her whim than even she could possibly use is incredibly exciting to her.
<<case "sadist">>
but the prospect of having more slaves at her whim than even she could possibly break is incredibly exciting to her.
<<case "masochist">>
especially for a masochist like her.
<<default>>
though one she's willing to take on.
<</switch>>
It will mean that she'll see much less of you, something such a devoted slave may struggle with. Oppressed by the confusion and strength of her feelings, she begins to cry.
<br><br>
"Thank you,
<<if SlaveStatsChecker.checkForLisp($activeSlave)>>
<<if def $PC.customTitleLisp>>$PC.customTitleLisp<<elseif $PC.title != 0>>Mathter<<else>>Mithtreth<</if>>," she gasps out. "I'll do my betht."
<<else>>
<<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>>," she gasps out. "I'll do my best."
<</if>>
|
r3d/fc
|
src/npc/agent/agentWorkaround.tw
|
tw
|
bsd-3-clause
| 4,400
|
:: AS Dump
<<set $dumped to 0>>
<<for $i to 0; $i < $slaves.length; $i++>>
<<if $activeSlave.ID == $slaves[$i].ID>>
<<set $slaves[$i] to $activeSlave>>
<<set $dumped to 1>>
<<break>>
<</if>>
<</for>>
<<if $dumped == 0>>
<<if def $activeSlave.slaveName>>
<<AddSlave $activeSlave>>
<<set $dumped to 1>>
<</if>>
<</if>>
<<goto $returnTo>>
|
r3d/fc
|
src/npc/asDump.tw
|
tw
|
bsd-3-clause
| 349
|
:: custom Slaves Database
<<set _i = 1000000>>
|
r3d/fc
|
src/npc/databases/customSlavesDatabase.tw
|
tw
|
bsd-3-clause
| 49
|
:: DF Slaves Database
<<set _i = 700000>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Cherry", _HS.birthName = "Cherry", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.health = 20, _HS.devotion = 75, _HS.pubicHColor = "black", _HS.skin = "white", _HS.hColor = "black", _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.boobs = 500, _HS.nipplesPiercing = 1, _HS.butt = 3, _HS.lips = 35, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.attrXY = 40, _HS.fetish = "submissive", _HS.fetishKnown = 1, _HS.customTat = "Two cherries are tattooed in her right butt cheek and in her left cheek.">>
Vag implant, vibe nips
<<set $heroSlaves.push(clone(_HS))>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Strawberry", _HS.birthName = "Strawberry", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 30, _HS.physicalAge = 30, _HS.visualAge = 30, _HS.health = 20, _HS.devotion = 40, _HS.height = 175, _HS.hColor = "blonde", _HS.pubicHColor = "blonde", _HS.skin = "tanned", _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.waist = 1, _HS.boobs = 1000, _HS.boobsImplant = 400, _HS.nipplesPiercing = 1, _HS.butt = 5, _HS.buttImplant = 2, _HS.lips = 35, _HS.lipsImplant = 10, _HS.vagina = 2, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 2, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.oralSkill = 35, _HS.analSkill = 35, _HS.attrXY = 40, _HS.fetish = "humiliation", _HS.fetishKnown = 1, _HS.customTat = "Strawberries are tattooed on her right buttock and on her left cheek.">>
vibe nips, muscles
<<set $heroSlaves.push(clone(_HS))>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Melon", _HS.birthName = "Melon", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 23, _HS.physicalAge = 23, _HS.visualAge = 23, _HS.health = 20, _HS.devotion = 30, _HS.height = 175, _HS.hColor = "red", _HS.pubicHColor = "red", _HS.skin = "tanned", _HS.hLength = 10, _HS.hStyle = "short", _HS.pubicHStyle = "waxed", _HS.boobs = 1800, _HS.boobsImplant = 800, _HS.nipplesPiercing = 1, _HS.butt = 4, _HS.lips = 35, _HS.lipsImplant = 10, _HS.vagina = 2, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 2, _HS.ovaries = 1, _HS.vaginalSkill = 15, _HS.oralSkill = 100, _HS.analSkill = 15, _HS.attrXY = 40, _HS.fetish = "submissive", _HS.fetishKnown = 1, _HS.customTat = "Watermelons are tattooed on her buttocks and on her face.">>
vibe nips, saliva implant
<<set $heroSlaves.push(clone(_HS))>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Carambola", _HS.birthName = "Carambola", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 25, _HS.physicalAge = 25, _HS.visualAge = 25, _HS.health = 20, _HS.devotion = 50, _HS.height = 175, _HS.hColor = "dark blonde", _HS.pubicHColor = "dark blonde", _HS.skin = "tanned", _HS.hLength = 60, _HS.hStyle = "curly and long, and in pigtails", _HS.pubicHStyle = "waxed", _HS.boobs = 650, _HS.nipplesPiercing = 1, _HS.butt = 8, _HS.buttImplant = 4, _HS.lips = 35, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 3, _HS.ovaries = 1, _HS.vaginalSkill = 15, _HS.oralSkill = 15, _HS.analSkill = 100, _HS.attrXY = 40, _HS.fetish = "buttslut", _HS.fetishKnown = 1, _HS.customTat = "Carambolas – starfruits - are tattooed on her buttocks and on her face.">>
vibe nips, saliva implant lube
<<set $heroSlaves.push(clone(_HS))>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Banana", _HS.birthName = "Banana", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 28, _HS.physicalAge = 28, _HS.visualAge = 28, _HS.health = 20, _HS.devotion = 30, _HS.race = "latina", _HS.hColor = "black", _HS.pubicHColor = "black", _HS.skin = "light brown", _HS.hLength = 0, _HS.hStyle = "shaved bald", _HS.pubicHStyle = "waxed", _HS.boobs = 400, _HS.nipplesPiercing = 1, _HS.butt = 5, _HS.lips = 35, _HS.vagina = 2, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 2, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.oralSkill = 100, _HS.analSkill = 35, _HS.attrXY = 40, _HS.fetish = "submissive", _HS.fetishKnown = 1, _HS.customTat = "Bananas are tattooed on her buttocks and on her face.">>
vibe nips, big pusslips+clit
<<set $heroSlaves.push(clone(_HS))>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Green Grape", _HS.birthName = "Green Grape", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.health = 20, _HS.devotion = 40, _HS.race = "pacific islander", _HS.hColor = "black", _HS.pubicHColor = "black", _HS.skin = "pale", _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.boobs = 650, _HS.nipplesPiercing = 1, _HS.butt = 4, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 1, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.oralSkill = 35, _HS.analSkill = 35, _HS.attrXX = 80, _HS.attrXY = 40, _HS.fetishKnown = 1, _HS.customTat = "Green grapes are tattooed on her buttocks and on her face.", _HS.mother = -100000, _HS.father = -100000>>
vibe nips, implant link to sister
<<set $heroSlaves.push(clone(_HS))>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Purple Grape", _HS.birthName = "Purple Grape", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 23, _HS.physicalAge = 23, _HS.visualAge = 23, _HS.health = 20, _HS.devotion = 40, _HS.race = "pacific islander", _HS.hColor = "black", _HS.pubicHColor = "black", _HS.skin = "light brown", _HS.hLength = 60, _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.boobs = 650, _HS.nipplesPiercing = 1, _HS.butt = 4, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 1, _HS.ovaries = 1, _HS.vaginalSkill = 35, _HS.oralSkill = 35, _HS.analSkill = 35, _HS.attrXX = 80, _HS.attrXY = 40, _HS.fetishKnown = 1, _HS.customTat = "Purple grapes are tattooed on her buttocks and on her face.", _HS.mother = -100000, _HS.father = -100000>>
vibe nips, implant link to sister
<<set $heroSlaves.push(clone(_HS))>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Apple", _HS.birthName = "Apple", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 28, _HS.physicalAge = 28, _HS.visualAge = 28, _HS.health = 20, _HS.devotion = 40, _HS.muscles = 20, _HS.pubicHColor = "black", _HS.skin = "pale", _HS.hColor = "black", _HS.hStyle = "long", _HS.pubicHStyle = "waxed", _HS.boobs = 500, _HS.nipplesPiercing = 1, _HS.butt = 3, _HS.lips = 55, _HS.lipsTat = "permanent makeup", _HS.vagina = 3, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.ovaries = 1, _HS.vaginalSkill = 15, _HS.oralSkill = 15, _HS.vaginalAccessory = "large dildo", _HS.buttplug = "large plug", _HS.attrXY = 40, _HS.fetish = "submissive", _HS.fetishKnown = 1, _HS.customTat = "Cored apples are tattooed on her buttocks and on her face.">>
vibe nips, stupid, sensitive, no masturb implant
<<set $heroSlaves.push(clone(_HS))>>
<<if $seeExtreme == 1>>
<<set _HS = clone($activeSlave)>>
<<set _HS.slaveName = "Plum", _HS.birthName = "Plum", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 28, _HS.physicalAge = 28, _HS.visualAge = 28, _HS.health = 20, _HS.devotion = 75, _HS.muscles = 20, _HS.hColor = "wavy brown", _HS.skin = "pale", _HS.hLength = 20, _HS.hStyle = "short", _HS.pubicHStyle = "waxed", _HS.boobs = 400, _HS.nipplesPiercing = 1, _HS.butt = 2, _HS.lips = 35, _HS.vagina = 3, _HS.vaginaLube = 1, _HS.vaginaPiercing = 2, _HS.preg = -2, _HS.anus = 2, _HS.ovaries = 1, _HS.vaginalSkill = 15, _HS.oralSkill = 15, _HS.analSkill = 15, _HS.vaginalAccessory = "large dildo", _HS.buttplug = "large plug", _HS.attrXY = 40, _HS.fetish = "mindbroken", _HS.fetishKnown = 1, _HS.customTat = "cored plums are tattooed on her buttocks and on her face.", _HS.customDesc = "She has massive C-clamp piercings in her back that allow her to act as furniture. Truly enormous vagina.">>
vibe nips, can act as furniture
<<set $heroSlaves.push(clone(_HS))>>
<</if>>
|
r3d/fc
|
src/npc/databases/dfSlavesDatabase.tw
|
tw
|
bsd-3-clause
| 7,958
|
:: FBoobs
<<nobr>>
<<set $activeSlave.mammaryCount++, $mammaryTotal++>>
You call her over so you can play with her
<<if ($activeSlave.boobs >= 20000)>>
colossal
<<elseif ($activeSlave.boobs >= 10000)>>
massive
<<elseif ($activeSlave.boobs >= 5000)>>
monster
<<elseif ($activeSlave.boobs >= 1000)>>
huge
<<elseif ($activeSlave.boobsImplant gt 250)>>
fake
<<elseif ($activeSlave.boobs gte 650)>>
big
<<elseif ($activeSlave.boobs gte 300)>>
small
<<else>>
flat
<</if>>
tits.
<<if ($activeSlave.boobsTat is "tribal patterns")>>
The tattoos on her breasts certainly draw attention to her nipples.
<<elseif ($activeSlave.boobsTat is "scenes")>>
The tattoos on her abdomen nicely illustrate what you mean to do with her: a titfuck.
<<elseif ($activeSlave.boobsTat is "degradation")>>
The tattoos on her chest are asking you to use those breasts, after all.
<</if>>
<<if ($activeSlave.nipples is "huge")>>
Her nipples are so large they give her breasts an unavoidably lewd appeal as they jut outward.
<<elseif ($activeSlave.nipples is "puffy")>>
Her puffy nipples beg to be sucked.
<<elseif ($activeSlave.nipples is "partially inverted") and ($activeSlave.nipplesPiercing is 0)>>
Her partially inverted nipples should protrude at the slightest stimulation.
<<elseif ($activeSlave.nipples is "inverted") and ($activeSlave.nipplesPiercing is 0)>>
Her inverted nipples form lewd little creases across her areolae.
<</if>>
<<if ($activeSlave.nipplesPiercing gt 1) and ($activeSlave.amp is 1)>>
You carry her over, playing with the chain between her nipples.
<<elseif ($activeSlave.nipplesPiercing gt 1)>>
You pull her over by the chain between her nipples.
<<elseif ($activeSlave.nipplesPiercing is 1)>>
Her nipple piercings glint enticingly.
<</if>>
<<if $PC.preg >= 24>>
<<if $PC.dick == 1>>
You lay her down on the couch on her back, lather oil onto her breasts and gingerly straddle her face; your stiff prick between her tits and under your belly, and your needy cunt over her mouth.
<<if ($activeSlave.boobs >= 20000)>>
Her breasts are so colossal you can barely maintain this position. They completely devour your dick and threaten to swallow up your pregnant belly as well. Between her licking, and the fleshy prison surrounding your privates, it doesn't take long for you to soak her face and plant your seed deep into her cleavage.
<<elseif ($activeSlave.boobs >= 10000)>>
Her breasts are so massive you can barely maintain this position. They completely devour your dick and swell around the sides of your pregnancy as well. Between her licking, and the fleshy prison surrounding your privates, it doesn't take long for you to soak her face and plant your seed deep into her cleavage.
<<elseif ($activeSlave.boobs >= 5000)>>
Her breasts are so monstrous they completely devour your dick and tickle your pregnant belly. Pushing her breasts together under your gravidness, you thrust between them and the underside of your middle, all the while rubbing your pussy into her face. With her licking, and all the flesh against your cock, it doesn't take long for you to soak her face and plant your seed deep into her cleavage.
<<elseif ($activeSlave.boobs >= 1000)>>
Her huge breasts fill the area under your pregnancy nicely. Pushing them together under your gravidness, you thrust between them and the underside of your middle, all the while rubbing your pussy into her face. With her licking, and all the flesh against your cock, it doesn't take long for you to soak her face and plant your seed deep into her cleavage.
<<elseif ($activeSlave.boobsImplant > 250)>>
Her fake breasts fill the area under your pregnancy nicely. Pushing them together under your gravidness, you thrust between them and the underside of your middle, all the while rubbing your pussy into her face. With her licking, and all the flesh against your cock, it doesn't take long for you to soak her face and plant your seed deep into her cleavage.
<<elseif ($activeSlave.boobs >= 650)>>
Her big breasts fill the area under your pregnancy nicely. You thrust between them and the underside of your middle, all the while rubbing your pussy into her face. With her licking, and all the flesh against your cock, it doesn't take long for you to soak her face and plant your seed deep into her cleavage.
<<elseif ($activeSlave.boobs >= 300)>>
You have to feel around under your pregnancy to hold your cock against her tiny breasts. You thrust against them and your hand, while the other teases your middle, all the while rubbing your pussy against her face. Between her licking, and your own teasing, it doesn't take long for you to soak her face and splatter your seed across her front.
<<else>>
You have to lean forward and pin your cock against her flat chest with the underside of your own pregnancy to make any real channel to thrust into. You fondle your belly<<if $PC.boobs > 0>> and breasts<</if>>, all the while rubbing your pussy against her face. Between her licking, and your own teasing, it doesn't take long for you to soak her face and splatter your seed across your underbelly and her front. You turn around and have her lick you clean before pulling your gravid bulk off of her.
<</if>>
<<else>>
You lay her down on the couch on her back, lather oil onto her breasts and gingerly straddle her face; your needy cunt over her mouth.
<<if ($activeSlave.boobs >= 20000)>>
Her breasts are so colossal you can barely maintain this position, but they are massively fun to play with as she eats you out. You massage your pregnancy with her acres of breast flesh, teasing your own stretched skin with hers. You can visably see the vibrations running through her tits as you quiver from the mouth working your pussy. Thoroughly soaking her, you fall into her endless cleavage for a short rest.
<<elseif ($activeSlave.boobs >= 10000)>>
Her breasts are so massive you can barely maintain this position, but they are fun to play with as she eats you out. You massage the edges of your pregnancy with her breast flesh, teasing your own stretched skin with hers. You can visably see the vibrations running through her tits as you quiver from the mouth working your pussy. Thoroughly soaking her, you fall into her immense cleavage for a short rest.
<<elseif ($activeSlave.boobs >= 5000)>>
Her breasts are so monstrous they make a fabulous rest for your pregnancy as she eats you out. You tease her breasts using your baby bump, rubbing it against them and vice versa. You can visably see the vibrations running through her tits as you quiver from the mouth working your pussy. Thoroughly soaking her, you dismount and lean against her monster breasts for a quick rest.
<<elseif ($activeSlave.boobs >= 1000)>>
Her breasts are huge enough to support your pregnancy as she eats you out. You press your belly more and more into them as her tongue delves deeper into your folds. You can visably see the vibrations running through the breast flesh forced to the sides of your middle as you quiver from the mouth working your pussy. Thoroughly soaking her, you dismount and lean against her huge breasts for a quick rest.
<<elseif ($activeSlave.boobs >= 650)>>
Her big breasts fill the area under your pregnancy nicely. You press your belly more and more into them as her tongue delves deeper into your folds. You can visably see the vibrations running through the breast flesh forced to the sides of your middle as you quiver from the mouth working your pussy. Thoroughly soaking her, you dismount and lean against her big breasts for a quick rest.
<<elseif ($activeSlave.boobs >= 300)>>
Her tiny breasts are completely covered by your pregnancy. You reach under yourself, grabbing what you can of her breasts and pushing them against your crotch. Between rubbing her breasts against your self and her tongue in your pussy, you quickly climax, thoroughly soaking her.
<<else>>
Her flat chest is completely covered by your pregnancy. Reach under yourself, you feel around until you find her nipples. You tease her flat chest until you're at you limit, thoroughly soaking her, before dimsounting and returning to your desk.
<</if>>
<</if>>
<<elseif ($activeSlave.amp is 1)>>
<<if $PC.dick == 1>>
Her limbless <<if $seeRace is 1>>$activeSlave.race <</if>>torso makes her a unique appliance for mammary intercourse. You lay her down on the ground on her back, lube her cleavage, and straddle her torso. With your cock between her breasts, you <<if ($activeSlave.boobs gt 650)>>squash her tits together to form a nice lubricated channel,<<else>>hold your cock in place,<</if>> and ride back and forth on her.<<if $PC.vagina == 1>> Your pussylips rub deliciously across her sternum.<</if>> She has some trouble breathing under the assault, but she manages. And for the finale, she's totally unable to avoid a perfect cumshot.
<<elseif $PC.boobs isnot 0>>
You set her limbless torso upright on your lap, facing you, so that your breasts and hers are resting heavily against one another. She turns her head to avoid getting splashed in the eyes as you add a generous coating of oil to the heaving breastflesh. You reach around to grab her by the hips and slide her up and down, giving you both a wonderful mammary oil massage.
<<else>>
You set her limbless torso on the floor, and tease her for a while until her nipples are rock hard. This done, you kneel down on her with each of your legs aside her torso, and hump your pussy back and forth on the stiff nub of one nipple. She lies there, unable to do anything but comply, squirming with the stimulation.
<</if>>
<<elseif tooBigBelly($activeSlave)>>
<<if $PC.dick == 1>>
Her excessively large belly makes her a unique appliance for mammary intercourse. You lay her down on the ground on her back, lube her cleavage, and gingerly fit yourself between her belly and her breasts. With your cock between her breasts, you <<if ($activeSlave.boobs > 650)>>squash her tits together to form a nice lubricated channel,<<else>>hold your cock in place,<</if>> and ride back and forth on her. You blast her in the face with your cum in no time<<if $PC.vagina == 1>>, leaving your pussyjuice on her belly where you rubbed against her<</if>>.
<<elseif $PC.boobs != 0>>
You lie down on top of her, face to face, forced high into the air by her excessively large belly, so that your breasts press into her<<if ($activeSlave.boobs >= 20000)>> colossal tits.<<elseif ($activeSlave.boobs >= 10000)>> massive tits.<<elseif ($activeSlave.boobs >= 5000)>> monster tits.<<elseif ($activeSlave.boobs >= 1000)>> huge tits.<<elseif ($activeSlave.boobsImplant > 250)>> fake tits.<<elseif ($activeSlave.boobs >= 650)>> big tits.<<elseif ($activeSlave.boobs >= 300)>> small tits.<<else>> flat chest.<</if>> Scooting around to stimulate your nipples against her warm breastflesh, you kiss the slave while pushing a hand down between you to schlick yourself against her.
<<else>>
You set her massively distended body on the floor, and tease her for a while until her nipples are rock hard. This done, you kneel down on her with each of your legs aside her torso, rear against the top of her belly, and hump your pussy back and forth on the stiff nub of one nipple. She lies there, desperately trying to reach around her bulk to her own pussy, but unable to do so, resorts to squirming with the stimulation.
<</if>>
<<elseif tooBigBreasts($activeSlave)>>
<<if $PC.dick == 1>>
Her excessive breasts make her a unique appliance for mammary intercourse. You lay her down on the ground on her back, lube her cleavage, and straddle her torso. She holds her udders together, creating a warm, wet channel as fuckable as any hole. You blast her in the face with your cum in no time<<if $PC.vagina == 1>>, leaving your pussyjuice on her chest where you rubbed against her<</if>>.
<<elseif $PC.boobs != 0>>
You lie down on top of her, face to face, so that your much smaller breasts press into the massive pillows formed by her chest. Scooting around to stimulate your nipples against her warm breastflesh, you kiss the slave while pushing a hand down between you to schlick yourself against her.
<<else>>
You set her nearly helpless body on the floor and then scoot your hips under the massive weight of her tits. The heft feels nice against you, and you worm a naughty hand under there to play with yourself in the warm cave formed by your pelvis and her udders.
<</if>>
<<elseif tooBigButt($activeSlave)>>
<<if $PC.dick == 1>>
Her excessive butt makes her a unique appliance for mammary intercourse. You lay her down on the ground on her back, her butt hoisting her crotch high above her head, lube her cleavage, and straddle her torso. With your cock between her breasts, you <<if ($activeSlave.boobs > 650)>>squash her tits together to form a nice lubricated channel,<<else>>hold your cock in place,<</if>> and ride back and forth on her<<if $PC.vagina == 1>>, leaving your pussyjuice on her chest where you rubbed against her<</if>>. She has some trouble breathing under the assault, but she manages. And for the finale, she's totally unable to avoid a perfect cumshot.
<<elseif $PC.boobs != 0>>
You set her upright on your lap, facing you, so that your breasts and hers are resting heavily against one another and her massive ass covers your lap. She turns her head to avoid getting splashed in the eyes as you add a generous coating of oil to the combined breastflesh. You reach around to grab her luxurious ass and jiggle her up and down, giving you both a wonderful mammary oil massage.
<<else>>
You set her nearly helpless body on the floor and then scoot your hips under the massive weight of her tits. The heft feels nice against you, and you worm a naughty hand under there to play with yourself in the warm cave formed by your pelvis and her udders.
<</if>>
<<elseif ($activeSlave.fetish is "boobs") and ($activeSlave.fetishStrength > 60) and ($activeSlave.fetishKnown is 1) and ($PC.dick == 1)>>
She comes over hurriedly, already presenting her breasts. She gives you a titjob with her lubricated cleavage while you sit at your desk, playing with her own nipples and moaning with pleasure.<<if $PC.vagina == 1>> She does her best to push her sternum hard against you, giving your pussy some stimulation, too.<</if>> As you get close to orgasm, you push her hands away and take over, rolling her $activeSlave.nipples nipples between your fingers and thumbs. When you finish, you give them a hard pull, sending her gasping over the edge as well.
<<elseif ($activeSlave.fetish is "cumslut") and ($activeSlave.fetishStrength > 60) and ($activeSlave.fetishKnown is 1) and ($activeSlave.dickAccessory is "chastity")>>
She comes over eagerly, with hunger in her eyes. She gives you a titjob with her lubricated cleavage while you sit at your desk. As a cumslut she's almost desperate to get your cum into her <<if $seeRace is 1>>$activeSlave.race <</if>>mouth and rubs a nipple with one hand and her anal opening with the other, since she can't touch her cock. The situation brings her some pleasure, but the first twitches of her cock against her chastity cage are so uncomfortable that she subsides into busy mechanical dick sucking. She writhes uncomfortably, frustrated beyond belief.
<<elseif ($activeSlave.fetish is "cumslut") and ($activeSlave.fetishStrength > 60) and ($activeSlave.fetishKnown is 1) and ($activeSlave.dick isnot 0) and ($PC.dick == 1)>>
She comes over eagerly, with hunger in her eyes. She gives you a titjob with her lubricated cleavage while you sit at your desk. As a cumslut she's almost desperate to get your cum into her <<if $seeRace is 1>>$activeSlave.race <</if>>mouth and <<if ($activeSlave.hormones lt 1) and ($activeSlave.balls isnot 0)>>jacks herself off<<else>>rubs her sadly limp member<</if>> in anticipation. When you finish, she sits back with an ecstatic look on her face and lets your cum rest in her mouth as she climaxes into her hand. She pours her own cum from her hand into her mouth so it can mingle with yours.
<<elseif ($activeSlave.fetish is "cumslut") and ($activeSlave.fetishStrength > 60) and ($activeSlave.fetishKnown is 1) and ($PC.dick == 1)>>
She comes over eagerly, with hunger in her eyes. She gives you a titjob with her lubricated cleavage while you sit at your desk. As a cumslut she's almost desperate to get your cum into her <<if $seeRace is 1>>$activeSlave.race <</if>>mouth and rubs herself in anticipation. When you finish, she <<if $PC.vagina == 1>>quickly swallows and then runs her hot tongue down to your wet pussy, eagerly licking your juices<<else>>sits back with an ecstatic look on her face and lets your cum rest in her mouth as she climaxes<</if>>.
<<elseif $activeSlave.devotion < -20>>
She tries to refuse you, so you throw her down on the couch next to your desk and
<<if $PC.dick == 1>>
squeeze lubricant between her $activeSlave.skin breasts. You straddle her torso, hold her boobs together, and fuck her cleavage<<if $PC.vagina == 1>>, grinding your hips down against her to stimulate your pussy<</if>>. Your cum splashes her crying face.
<<elseif $PC.boobs isnot 0>>
squirt lubricant all over her $activeSlave.skin breasts. Then, you lie down atop her with your breasts meshing with hers and begin to slide up and down, stimulating your nipples wonderfully. She tries to turn her head away, but you reach up to force her unwilling mouth to accept your insistent tongue.
<<else>>
straddle her face, grinding your pussy against her unwilling mouth. You begin to grope her breasts and pinch her nipples to hardness, and hen she's slow at eating you out, you twist them cruelly. The pain makes her squeal into your pussy, a lovely sensation, so you manhandle her without mercy until you climax against her gasping face.
<</if>>
<<elseif ($activeSlave.devotion <= 20) and ($activeSlave.lactation gt 0)>>
She lies on the couch next to your
<<if $PC.dick == 1>>
desk and rubs lube over her $activeSlave.skin chest so you can fuck her tits. You straddle her torso, hold her boobs together, and fuck her cleavage. As you do, the pressure of your grip causes a thin rivulet of milk to run from each of her nipples. Your cum covers her reluctant face; between your semen<<if $PC.vagina == 1>>, the pussyjuice you left on her chest,<</if>> and her milk she's quite a mess.
<<elseif $PC.boobs isnot 0>>
desk and rubs lube over her $activeSlave.skin breasts. Then, you lie down atop her with your breasts meshing with hers and begin to slide up and down, titillating your nipples wonderfully. She cannot ignore the slippery stimulation her nipples are receiving, and you find her mouth quite willing to receive your insistent tongue. She begins to leak milk, adding her cream to the lube between your breasts, and by the time you're done there's quite a mess.
<<else>>
desk, and you've straddled her face before she can do anything more. You begin to grope her breasts and pinch her nipples to hardness as she eats you out, your ministrations producing prompt jets of creamy milk, straight up into the air. You milk her without mercy, shooting some of the stronger streams into your mouth as you ride her, leaving her to massage her breasts gingerly as you get off her face.
<</if>>
<<elseif $activeSlave.devotion <= 20>>
She lies on the couch next to your
<<if $PC.dick == 1>>
desk and rubs lube over her <<if $seeRace is 1>>$activeSlave.race <</if>>chest so you can fuck her $activeSlave.skin tits. You straddle her torso, hold her boobs together, and fuck her cleavage. Your cum covers her reluctant face<<if $PC.vagina == 1>>, and you hike yourself up a little higher to grind your pussy against her mouth<</if>>.
<<elseif $PC.boobs isnot 0>>
desk and rubs lube over her $activeSlave.skin breasts. Then, you lie down atop her with your breasts meshing with hers and begin to slide up and down, titillating your nipples wonderfully. She cannot ignore the slippery stimulation her nipples are receiving, and you find her mouth quite willing to receive your insistent tongue.
<<else>>
desk, and you've straddled her face before she can do anything more. You begin to grope her breasts and pinch her nipples to hardness as she eats you out, your ministrations producing moans that feel quite nice against your clit. You maul her boobs without mercy as you reach your climax, leaving her to massage her breasts gingerly as you get off her.
<</if>>
<<elseif ($activeSlave.lactation gt 0)>>
Since she's producing milk, she gets an emotional high from breastfeeding, and she sits on the edge of your desk for a while so you can use her as a beverage dispenser while you work. Once she's empty, she gets down to <<if ($PC.dick is 0)>>eat you out. As she buries her face between your legs, she gently rolls her sore nipples around in her fingers, quietly moaning and whining.<<else>>give you a titjob. As she titfucks you, she gently rolls her sore nipples around in her fingers, quietly moaning and whining. Your cum covers her <<if $seeRace is 1>>$activeSlave.race <</if>>face in no time, and she's left with a spectacular mess to clean. She laps it all up.<</if>>
<<else>>
<<if $PC.dick == 1>>
She massages and toys with her chest for your benefit, languidly rubbing lubricant over not only her cleavage but her entire chest, making sure every inch of her $activeSlave.skin breasts are nice and shiny. She gives you a titjob with her lubricated cleavage while you sit at your desk<<if $PC.vagina == 1>>, doing her best to run her hard nipples between your pussylips whenever she can<</if>>. Your cum covers her <<if $seeRace is 1>>$activeSlave.race <</if>>face, and she carefully licks it all off while continuing to play with her erect nipples.
<<elseif $PC.boobs isnot 0>>
She rubs lube over her $activeSlave.skin breasts, flirting with you and sticking out her chest, before lying down on the couch. You lie down atop her with your breasts meshing with hers and begin to slide up and down, titillating your nipples wonderfully. You find her mouth quite willing to receive your insistent tongue, and while you make out, she slips a hand down between your legs to give you a handjob, too.
<<else>>
She flirts with you and sticks out her chest before lying down on the couch. You've straddled her face before she can do anything more, and she begins to eat you out with enthusiasm. You begin to grope her breasts and pinch her nipples to hardness as she gives you oral, your ministrations producing moans that feel quite nice against your clit. You maul her boobs without mercy as you reach your climax, but she loves it all.
<</if>>
<</if>>
<<if (random(1,100) gt (100+$activeSlave.devotion))>>
<<if ($activeSlave.fetish isnot "boobs") and ($activeSlave.energy lte 95) and ($activeSlave.behavioralFlaw isnot "hates men")>>
Being manhandled and used has given her a @@color:red;hatred of men.@@
<<set $activeSlave.behavioralFlaw to "hates men">>
<</if>>
<<elseif (random(1,100) gt (110-$activeSlave.devotion))>>
<<if ($activeSlave.fetish is "none") and ($activeSlave.behavioralFlaw isnot "hates men")>>
Having attention and love lavished on her boobs by <<if def $PC.customTitle>>her $PC.customTitle<<elseif $PC.title isnot 0>>her master<<else>>her mistress<</if>> has her thinking of her @@color:lightcoral;breasts as sexual organs.@@
<<set $activeSlave.fetish to "boobs", $activeSlave.fetishKnown to 1>>
<</if>>
<</if>>
<<if ($activeSlave.amp isnot 1)>>
<<switch $activeSlave.assignment>>
<<case "work in the dairy">>
She goes off to carefully wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>> to keep production in $dairyName nice and sanitary.
<<case "whore">>
She heads off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>> before she returns to prostituting herself.
<<case "work in the brothel">>
She goes to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>>, even though it's likely to be splashed with customers' cum soon after she returns to work.
<<case "serve the public">>
She heads off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>> before she goes back out to fuck passersby.
<<case "serve in the club">>
She goes to beautify her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>> so it can again serve as an ornament to $clubName.
<<case "work as a servant">>
She rushes to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>>, afraid she's fallen behind on the chores while you used her.
<<case "rest">>
She stumbles off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>> before crawling back into bed.
<<case "train slaves">>
She heads off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>> before she returns to her classes.
<<case "get milked">>
She hurries off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>> <<if $activeSlave.lactation gt 0>>before going to get her uncomfortably milk-filled tits drained<<else>>and then rests until her balls are ready to be drained again<</if>>.
<<case "please you">>
She hurries off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>> before returning to await use, as though nothing had happened.
<<case "be a subordinate slave">>
She moves off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>>, though it's only a matter of time before another slave decides to play with her tits.
<<case "be a servant">>
She hurries off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>>, since her chores didn't perform themselves while you titfucked her.
<<case "be your Head Girl">>
She hurries off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>>, worried that her charges got up to trouble while she had her breasts around your cock.
<<case "guard you">>
She hurries off to wash her <<if $activeSlave.boobs gt 1500>>acre of cleavage<<elseif $activeSlave.boobs gt 500>>generous cleavage<<else>>chest<</if>> so that you will be unguarded for as little time as possible.
<</switch>>
<</if>>
<<if passage() isnot "Slave Interact">>
<<for _i to 0; _i lt $slaves.length; _i++>>
<<if $slaves[_i].ID is $activeSlave.ID>>
<<set $slaves[_i] to $activeSlave>>
<<break>>
<</if>>
<</for>>
<</if>>
<</nobr>>
|
r3d/fc
|
src/npc/descriptions/fBoobs.tw
|
tw
|
bsd-3-clause
| 27,179
|
:: FButt
<<nobr>>
You call her over so you can
<<if ($activeSlave.vagina is -1)>>
use her sole fuckhole.
<<elseif ($activeSlave.vagina gt 3)>>
fuck her gaping holes.
<<elseif ($activeSlave.vagina gt 2)>>
fuck her loose holes.
<<elseif ($activeSlave.vagina is 2)>>
use her whorish holes.
<<elseif ($activeSlave.vagina is 1)>>
use her tight holes.
<<elseif ($activeSlave.vagina is 0) or ($activeSlave.anus is 0)>>
take her virginity.
<</if>>
<<if ($activeSlave.vagina isnot -1)>>
<<if ($activeSlave.vaginaTat is "tribal patterns")>>
The tattoos on her abdomen certainly draw attention there.
<<elseif ($activeSlave.vaginaTat is "scenes")>>
The tattoos on her abdomen nicely illustrate what you mean to do to her.
<<elseif ($activeSlave.vaginaTat is "degradation")>>
The tattoos on her abdomen are asking you to, after all.
<</if>>
<</if>>
<<if ($activeSlave.vaginaPiercing gt 1)>>
Her pierced lips and clit have her nice and wet.
<<if ($activeSlave.dick isnot 0)>>
Metal glints all up and down her cock.
<</if>>
<<elseif ($activeSlave.vaginaPiercing is 1)>>
Her pierced clit has her nice and moist.
<<if ($activeSlave.dick isnot 0)>>
Metal glints at the head of her cock.
<</if>>
<</if>>
<<if ($activeSlave.anusPiercing gt 1)>>
The ring of stud piercings around her anus should massage you delightfully as you sodomize her.
<<elseif ($activeSlave.anusPiercing is 1)>>
Her perineum piercing has a big ring in it, which you should be able to feel when you hilt yourself in her ass.
<</if>>
<<if ($activeSlave.anusTat isnot 0) and ($activeSlave.anusTat isnot 4)>>
Her anus is invitingly bleached,
<<if ($activeSlave.vagina gt -1)>>
which is appropriate: rather than looking like she has a hole for fucking and an ass, it looks like she has two fuckholes.
<<elseif ($activeSlave.balls is 0)>>
making it look like she has a natural fuckhole despite the fact that she's a gelding.
<<else>>
making it look like she has a natural fuckhole despite the fact that she's a shemale.
<</if>>
<</if>>
<<if ($activeSlave.vagina is 0) and ($activeSlave.anus is 0) and canDoVaginal($activeSlave)>>
<<if ($PC.dick is 0)>>
You step into a strap-on, lubricate it, and break in her holes in quick succession.
<<else>>
Brooking no resistance, you take her virginity and then break in her virgin butt.
<</if>>
<<if ($activeSlave.devotion > 50)>>
You ease yourself into her pussy before gradually working your way into her ass and alternate between the two holes while she begins to moan. In just a few minutes, she has lost her virginity and been assfucked for the first time. She @@color:hotpink;submits utterly@@ to your spoilage of her innocence and thanks you meekly for introducing her to proper sexual slavery. @@color:lime;Her holes have been broken in.@@
<<set $activeSlave.devotion += 10>>
<<elseif ($activeSlave.devotion > 20)>>
You ease yourself into her pussy before gradually working your way into her ass and alternate between the two holes while she begins to moan. In just a few minutes, she has lost her virginity and been assfucked for the first time. She's so bewildered by the pain and novelty that all she feels is @@color:gold;a little fear@@ of further use. @@color:lime;Her holes have been broken in.@@
<<set $activeSlave.trust -= 5>>
<<else>>
You force yourself into her pussy before gradually working your way into her ass. She sobs and cries with disgust while you alternate between the two holes. In just a few minutes, she has lost her virginity to rape and her anal virginity to a rough buttfuck. To say she @@color:mediumorchid;resents you@@ and @@color:gold;fears further abuse@@ would be an understatement. @@color:lime;Her holes have been broken in.@@
<<set $activeSlave.devotion -= 10, $activeSlave.trust -= 10>>
<</if>>
<<set $activeSlave.vagina++, $activeSlave.anus++>>
<<BothVCheck>>
<<elseif ($activeSlave.vagina is 0) and canDoVaginal($activeSlave)>>
<<if ($activeSlave.devotion > 20)>>
She accepts your orders without comment and presents her virgin pussy for defloration<<if ($PC.dick is 0)>>, watching with some small trepidation as you don a strap-on<</if>>. You gently ease into her pussy before gradually increasing the intensity of your thrusts into her. Before long, she's moaning loudly as you pound away. Since she is already well broken, this new connection with <<if def $PC.customTitle>>her $PC.customTitle<<elseif $PC.title isnot 0>>her master<<else>>her mistress<</if>> @@color:hotpink;increases her devotion to you.@@ @@color:lime;Her pussy has been broken in.@@
<<set $activeSlave.devotion += 10>>
<<elseif ($activeSlave.devotion >= -20)>>
She is clearly unhappy at losing her pearl of great price to you; this probably isn't what she imagined her first real sex would be like.<<if ($PC.dick is 0)>>Her lower lip quivers with trepidation as she watches you don a strap-on and maneuver to fuck her virgin hole.<</if>> You gently ease into her pussy before gradually increasing the intensity of your thrusts into her. Before long, she's moaning as you pound away. Nevertheless, this new connection with <<if def $PC.customTitle>>her $PC.customTitle<<elseif $PC.title isnot 0>>her master<<else>>her mistress<</if>> @@color:hotpink;increases her devotion to you.@@ @@color:lime;Her pussy has been broken in,@@ and she is @@color:gold;fearful@@ that sex will continue to be painful.
<<set $activeSlave.devotion += 4>>
<<else>>
As you anticipated, she refuses to give you her virginity. And as you expected, she is unable to resist you. She cries as <<if ($PC.dick is 0)>>your strap-on<<else>>your cock<</if>> opens her fresh, tight hole. You force your way into her pussy and continue thrusting into her. She sobs and cries with horror as you pound away. The rape @@color:mediumorchid;decreases her devotion to you.@@ @@color:lime;Her pussy has been broken in,@@ and she @@color:gold;fears further abuse.@@
<<set $activeSlave.devotion -= 5>>
<</if>>
<<set $activeSlave.vagina++>>
<<VaginalVCheck>>
<<elseif ($activeSlave.anus is 0)>>
<<if ($activeSlave.devotion > 20)>>
She accepts your orders without comment and presents her virgin anus for defloration. You<<if ($PC.dick is 0)>> don a strap-on and<</if>> gently sodomize her. You gently ease yourself into her butthole and gradually speed up your thrusts while she slowly learns to move her hips along with you. Since she is already well broken, this new connection with <<if def $PC.customTitle>>her $PC.customTitle<<elseif $PC.title isnot 0>>her master<<else>>her mistress<</if>> @@color:hotpink;increases her devotion to you.@@ @@color:lime;Her tight little ass has been broken in.@@
<<set $activeSlave.devotion += 4>>
<<elseif ($activeSlave.devotion >= -20)>>
She is clearly unhappy at the idea of taking a dick up her butt. You gently ease yourself into her butthole and gradually speed up your thrusts. She obeys orders anyway, and lies there wincing and moaning as you<<if ($PC.dick is 0)>> don a strap-on and<</if>> fuck her ass. @@color:lime;Her tight little ass has been broken in,@@ and she @@color:gold;fears further anal pain.@@
<<else>>
She is appalled at the idea of taking it up the ass<<if ($PC.dick is 0)>> and cries with fear as you don a strap-on<</if>>. She does anyway though, sobbing into the cushions<<if $activeSlave.amp isnot 1>> while you hold her arms behind her<</if>>. You force yourself into her butthole. She sobs and cries with disgust while you continue thrusting into her ass. The painful anal rape @@color:mediumorchid;decreases her devotion to you.@@ @@color:lime;Her tight little ass has been broken in,@@ and she is @@color:gold;terrified of further anal pain.@@
<<set $activeSlave.devotion -= 5>>
<</if>>
<<set $activeSlave.anus++>>
<<AnalVCheck>>
<<elseif $activeSlave.devotion < -20>>
<<if ($PC.dick == 0)>>You don a cruelly large strap-on, and you do it so she can see it. <</if>>She tries to refuse you, so you throw her across the back of the couch next to your desk with her <<if $seeRace == 1>>$activeSlave.race <</if>>ass in the air. You finger her anus <<if ($activeSlave.vagina != -1)>>while fucking her pussy<<elseif ($activeSlave.amp != 1)>>while frotting her thighs<</if>> for a bit and then switch to her now-ready anus. She sobs as you penetrate her rectum.
<<if ($activeSlave.dick != 0) and canAchieveErection($activeSlave)>>
Despite her unwillingness to be sodomized, the prostate stimulation
<<if $activeSlave.dickAccessory is "chastity">>
starts to give her an erection, which her dick chastity makes horribly uncomfortable. She bucks with the pain, her asshole spasming delightfully.
<<else>>
gives her an erection. She's mortified that she would get hard while being anally raped.
<</if>>
<<elseif ($activeSlave.dickAccessory is "chastity")>>
Her dick chastity keeps her bitch cock hidden away while you use her anus like a pussy.
<<elseif ($activeSlave.dick isnot 0)>>
Her flaccid dick is ground into the back of the couch as you rape her.
<</if>>
<<BothVCheck>>
<<elseif $activeSlave.devotion <= 50>>
You throw her across the back of the couch next to your desk with her ass in the air<<if ($PC.dick is 0)>>, and don a strap-on<</if>>. You finger her <<if $seeRace is 1>>$activeSlave.race <</if>>ass while <<if ($activeSlave.vagina isnot -1)>>fucking her pussy<<else>>frotting her thighs<</if>> for a bit and then switch to her now-ready anus. <<if ($activeSlave.anus is 1)>>Her ass is so tight that you have to work yourself in.<<elseif ($activeSlave.anus is 2)>>Your <<if ($PC.dick is 0)>>fake dick<<else>>cock<</if>> slides easily up her ass.<<else>>You slide into her already-gaping asspussy with ease.<</if>> She gasps as you penetrate her rectum, but you timed the switch so that she was on the verge of orgasm, and she comes immediately.
<<if ($activeSlave.dick isnot 0) and ($activeSlave.hormones lt 1) and ($activeSlave.balls isnot 0)>>
<<if $activeSlave.dickAccessory is "chastity">>
She managed to stay soft within her dick chastity, but she dribbled a lot of precum onto the couch. You make her lick it up, and she obeys, shuddering with unsatisfied arousal.
<<else>>
Her cock spatters the couch with cum, and you make her lick it up.
<</if>>
<<elseif ($activeSlave.clit gt 2)>>
Her clit is so large that it bobs slightly with each thrust.
<</if>>
<<BothVCheck>>
<<else>>
<<if ($activeSlave.amp != 1)>>She kneels on the floor<<else>>You lay her on the floor<</if>> so you can take her at will<<if ($PC.dick == 0)>>, and don a strap-on<</if>>. You finger her <<if $seeRace == 1>>$activeSlave.race <</if>>ass while <<if ($activeSlave.vagina != -1)>>fucking her pussy<<else>>frotting her<</if>> for a bit and then switch to her now-ready anus. <<if ($activeSlave.anus == 1)>>Her ass is so tight that you have to work yourself in.<<elseif ($activeSlave.anus == 2)>>Your cock slides easily up her ass.<<else>>You slide into her already-gaping asspussy with ease.<</if>> You fuck her there for a while before repeatedly pulling out and stuffing yourself back in. She moans each time you fill a waiting hole.
<<if ($activeSlave.dick != 0) and canAchieveErection($activeSlave)>>
<<if $activeSlave.dickAccessory is "chastity">>
Whenever she starts to get hard, her dick chastity gives her an awful twinge of pain. You do your best to be up her butt when this happens so you can experience the resulting spasm.
<<else>>
Every time you penetrate, her erect dick jerks up and slaps her stomach.
<</if>>
<<elseif ($activeSlave.dick isnot 0)>>
<<if $activeSlave.dickAccessory is "chastity">>
Her dick chastity keeps her girly bitchclit hidden, just like it belongs.
<<else>>
Every time you penetrate, her limp dick flops around lamely.
<</if>>
<<elseif ($activeSlave.clit gt 2)>>
Her clit is so large that it bobs slightly with each thrust.
<</if>>
<<BothVCheck>>
<</if>>
<<if ($activeSlave.preg gt 10)>>
The poor girl's pregnant belly makes taking a rough fuck in both her holes uncomfortable for her.
<<elseif ($activeSlave.inflation > 0)>>
The poor girl's sloshing belly makes taking a rough fuck in both her holes uncomfortable for her, though the lewd jiggling the pounding sends through it is quite a sight.
<<elseif ($activeSlave.bellyImplant >= 2000)>>
The poor girl's implant filled belly makes taking a rough fuck in both her holes uncomfortable for her.
<</if>>
<<if ($activeSlave.anusTat is "scenes") and ($activeSlave.anus is 1)>>
As you fucked her butt, the decorative pattern around her ass stretched open. When you pull out, her momentary gape closes the pattern up quickly.
<<elseif ($activeSlave.anusTat is "scenes")>>
As you fucked her butt, the decorative pattern around her ass stretched open. When you pull out, her gape leaves the pattern distorted.
<<elseif ($activeSlave.anusTat is "degradation")>>
As you fucked her butt, the offensive language around her ass stretched and distorted.
<</if>>
<<if (random(1,100) gt (100+$activeSlave.devotion))>>
<<if ($activeSlave.fetish isnot "buttslut") and ($activeSlave.energy lte 95) and ($activeSlave.sexualFlaw isnot "hates penetration")>>
Being brutally used has given her a @@color:red;hatred of penetration.@@
<<set $activeSlave.sexualFlaw to "hates penetration">>
<</if>>
<<elseif (random(1,100) gt (110-$activeSlave.devotion))>>
<<if ($activeSlave.fetish is "none") and ($activeSlave.sexualFlaw isnot "hates penetration")>>
Orgasming to your use of her fuckhole @@color:lightcoral;has her eager for more buttsex.@@
<<set $activeSlave.fetish to "buttslut", $activeSlave.fetishKnown to 1>>
<</if>>
<</if>>
<<if ($PC.dick == 1)>>
<<if ($activeSlave.anus gt 3)>>
Her gaping hole drips your cum right out again.
<<elseif ($activeSlave.anus gt 2)>>
Cum drips out of her loose hole.
<<elseif ($activeSlave.anus is 2)>>
Cum drips out of her loosened anus.
<<elseif ($activeSlave.anus is 1)>>
Her still-tight ass keeps your load inside her.
<</if>>
<<if canWalk($activeSlave)>>
<<switch $activeSlave.assignment>>
<<case "whore">>
She heads to the bathroom to clean her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes before returning to selling them publicly.<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole before returning to selling it publicly.<<else>>face before returning to selling her mouth publicly.<</if>>
<<case "serve the public">>
She heads to the bathroom to clean her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes before returning to offering it for free.<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole before returning to offering it for free.<<else>>face before returning to offering her mouth for free.<</if>>
<<case "rest">>
She stumbles to the bathroom to clean her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>> before crawling back into bed.
<<case "train slaves">>
She heads to the bathroom to clean her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>> before she returns to teaching her classes.
<<case "get milked">>
She hurries to the bathroom to clean her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>> <<if $activeSlave.lactation gt 0>>before going to get her uncomfortably milk-filled tits drained<<else>>and then rests until her balls are ready to be drained again<</if>>.
<<case "please you">>
She hurries to the bathroom to clean her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>> before returning to await your next use of her body, as though nothing had happened.
<<case "be a subordinate slave">>
She moves to the bathroom to clean her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>>, though it's only a matter of time before another slave decides to play with her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>pussy or asshole<<elseif canDoVaginal($activeSlave)>>pussy<<elseif canDoAnal($activeSlave)>>asshole<<else>>face<</if>>.
<<case "be a servant">>
She hurries to the bathroom to clean her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>>, since her chores didn't perform themselves while you used her.
<<case "be your Head Girl">>
She hurries to the bathroom to clean her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>>, worried that her charges got up to trouble while you had your cock in her.
<<case "guard you">>
She hurries off to wash her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>> so you'll be unguarded for as little time as possible.
<<case "work in the brothel">>
She goes to wash her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>> so her next customer can have the illusion that he's the first to use it today.
<<case "serve in the club">>
She goes to wash and delicately perfume her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes so they<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole so it<<else>>face so it<</if>> can gratify the finest citizen.
<<case "work in the dairy">>
She goes off to carefully wash her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>> to avoid besmirching the nice clean dairy.
<<case "work as a servant">>
She rushes to wash her <<if canDoVaginal($activeSlave) && canDoAnal($activeSlave)>>holes<<elseif canDoVaginal($activeSlave) || canDoAnal($activeSlave)>>fuckhole<<else>>face<</if>>, impatient to get back to her undiminished chores.
<</switch>>
<</if>>
<</if>>
<<if passage() isnot "Slave Interact">>
<<for _i to 0; _i lt $slaves.length; _i++>>
<<if $slaves[_i].ID is $activeSlave.ID>>
<<set $slaves[_i] to $activeSlave>>
<<break>>
<</if>>
<</for>>
<</if>>
<</nobr>>
|
r3d/fc
|
src/npc/descriptions/fButt.tw
|
tw
|
bsd-3-clause
| 18,611
|
:: FFuckdoll [nobr widget]
<<widget "FFuckdollOral">>
<<set $activeSlave.oralCount++, $oralTotal++>>
You decide to use the Fuckdoll's <<if $activeSlave.lips > 95>>facepussy<<else>>face hole<</if>>.
<<if $activeSlave.fuckdoll <= 10>>
Since it is not well adapted to life as a living sex toy yet, it won't respond to position commands. So, you simply <<if $activeSlave.amp == 0>>shove it into a kneeling position<<else>>set it on the couch<</if>> and straddle its face.
<<elseif $activeSlave.fuckdoll <= 80>>
It can follow intermediate commands, so you order it into a position for use of its face hole. It obediently <<if $activeSlave.amp == 0>>gets to its knees<<else>>cranes its neck up<</if>> and sticks its tongue out as far as it will go, wiggling it invitingly. You straddle its face.
<<else>>
It can follow advanced commands, so you order it into a position for use of its face hole. It instantly <<if $activeSlave.amp == 0>><<if $PC.dick == 1>>bends at the waist and turns its head upward, placing its throat horizontally and at waist height.<<else>>gets to its knees and turns its head upward at just the right angle for a pussy to ride its face hole.<</if>><<else>>cranes its neck up and sticks its tongue out as far as it will go, wiggling it invitingly.<</if>> You straddle its face.
<</if>>
<<if $activeSlave.fuckdoll <= 20>>
It's not fully used to being surprised with face rape, so it struggles, and its difficulty breathing <<if $PC.dick == 1>>makes its throat spasm around your dickhead<<else>>feels lovely on your cunt<</if>>.
<<elseif $activeSlave.fuckdoll <= 50>>
Aware that it is supposed to relax and let you rape its face, it does its best to let you <<if $PC.dick == 1>>fuck its throat<<else>>ride its face<</if>>.
<<else>>
You command it to <<if $PC.dick == 1>>milk your dick, and it begins to suck with almost frightening force<<else>>pleasure your cunt, and it begins to eat you out with almost frightening hunger<</if>>.
<</if>>
<<if $activeSlave.fuckdoll <= 60>>
<<if $activeSlave.energy > 80>>Denied any other outlet for its extreme sex drive, it orgasms from nothing more than oral stimulation.<</if>>
<<else>>
It's so perfectly tuned that it begins to orgasm from nothing more than oral stimulation, and it continues to shiver with repeated orgasms as it sucks.
<</if>>
You climax, <<if $PC.dick == 1>>blowing your load down its throat<<else>>giving it a good amount of femcum to swallow<</if>>, and return it to <<if $activeSlave.amp == 0>>a standing position<<else>>where it was resting<</if>>.
<<if $PC.dick == 1>>
<<if $activeSlave.lips > 95>>It gives sloppy blowjobs, its lips being too big for much control, and strings of your cum beribbon its suit. The Fuckdoll will be cleaned by another slave.
<<else>>It swallows repeatedly as it returns to its resting posture.
<</if>>
<</if>>
<<if passage() != "Slave Interact">>
<<set _SL = $slaves.length>>
<<for _i = 0; _i < _SL; _i++>>
<<if $slaves[_i].ID == $activeSlave.ID>>
<<set $slaves[_i] = $activeSlave>>
<<break>>
<</if>>
<</for>>
<</if>>
<</widget>>
<<widget "FFuckdollVaginal">>
<<set $activeSlave.vaginalCount++, $vaginalTotal++>>
You decide to use the Fuckdoll's <<if $activeSlave.vagina > 3>>cavernous<<elseif $activeSlave.vagina == 3>>soft<<elseif $activeSlave.vagina == 2>>inviting<<elseif $activeSlave.vagina == 1>>tight<</if>> front hole.
<<if $activeSlave.fuckdoll <= 10>>
Since it is not well adapted to life as a living sex toy yet, it won't respond to position commands. So, you simply <<if $activeSlave.amp == 0>>push it down to lie on the couch<<else>>set it on your desk<</if>> and shove <<if $PC.dick == 1>>your cock<<else>>a strap-on<</if>> inside its vagina.
<<elseif $activeSlave.fuckdoll <= 70>>
It can follow intermediate commands, so you order it into a position for use of its front hole. It obediently <<if $activeSlave.amp == 0>>gets down on all fours and <</if>>cocks its hips, offering its cunt until you insert <<if $PC.dick == 1>>your cock<<else>>a strap-on<</if>> into its wet channel.
<<else>>
It can follow advanced commands, so you bring it over to your chair <<if $activeSlave.amp == 0>>and order it to squat down onto your <<if $PC.dick == 1>>cock<<else>>strap-on<</if>> and ride.<<else>>and impale it on <<if $PC.dick == 1>>your cock<<else>>your strap-on<</if>>, ordering it to do its feeble best to bounce.<</if>>
<</if>>
<<if $activeSlave.fuckdoll <= 20>>
It's not fully used to being raped without warning, so it struggles, its muscles spasming delightfully.
<<elseif $activeSlave.fuckdoll <= 40>>
Aware that it is supposed to relax and accept rape, it does its best to let you take it without resistance.
<<else>>
You command it to milk your <<if $PC.dick == 1>>cock<<else>>strap-on<</if>> with its vaginal walls, and it obediently starts to flex its well-developed cunt muscles, squeezing <<if $PC.dick == 1>>you<<else>>your strap-on<</if>> from base to tip.
<</if>>
<<if $activeSlave.fuckdoll <= 60>>
<<if $activeSlave.energy > 40>>Denied any other outlet for its healthy sex drive, it orgasms.<</if>>
<<else>>
It orgasmed for the first time as you entered it, and it continues to do so as you fuck it. It's perfectly tuned.
<</if>>
<<if $activeSlave.voice == 0>>
Though it is mute, its breath hisses loudly <<if $activeSlave.lips > 95>>past the lips of its facepussy<<else>>through its mouth insert<</if>>.
<<else>>
It moans, <<if $activeSlave.lips > 95>>and the lips of its facepussy quiver<<else>>struggling to force the sound past its mouth insert<</if>>.
<</if>>
You climax<<if $PC.dick == 1>>, your cum shooting forward to splash against its womb,<</if>> and return it to <<if $activeSlave.amp == 0>>a standing position<<else>>where it was resting<</if>>.
<<if $PC.dick == 1>>
<<if $activeSlave.vagina > 2>>Your cum flows out of its gaping front hole and down the material of its suit.
<<elseif $activeSlave.vagina == 2>>Your cum drips out of its well-fucked front hole and down the material of its suit.
<<else>>Its tight front hole retains almost every drop of your cum. A few escape and run down the material of its suit.
<</if>>
The Fuckdoll will be cleaned by another slave.
<</if>>
<<if $activeSlave.vagina == 0>>
<<if $activeSlave.fetish != "mindbroken">>
As you return to your business, it shakes slightly in place, and a few low moans come out of its face hole. This is probably a reaction to losing its virginity.
<<else>>
It gives no external indication that it's aware that it's just lost its virginity.
<</if>>
In any case, @@color:lime;its front hole has been broken in.@@
<<set $activeSlave.vagina = 1>>
<</if>>
<<if passage() != "Slave Interact">>
<<set _SL = $slaves.length>>
<<for _i = 0; _i < _SL; _i++>>
<<if $slaves[_i].ID == $activeSlave.ID>>
<<set $slaves[_i] = $activeSlave>>
<<break>>
<</if>>
<</for>>
<</if>>
<</widget>>
<<widget "FFuckdollAnal">>
<<set $activeSlave.analCount++, $analTotal++>>
You decide to use the Fuckdoll's <<if $activeSlave.anus > 3>>gaping<<elseif $activeSlave.anus == 3>>loose<<elseif $activeSlave.anus == 2>>relaxed<<elseif $activeSlave.anus == 1>>tight<</if>> rear hole.
<<if $activeSlave.fuckdoll <= 10>>
Since it is not well adapted to life as a living sex toy yet, it won't respond to position commands. So, you simply <<if $activeSlave.amp == 0>>walk over to it<<else>>flip it over<</if>> and ram <<if $PC.dick == 1>>your cock<<else>>a strap-on<</if>> up its rear hole.
<<elseif $activeSlave.fuckdoll <= 80>>
It can follow intermediate commands, so you order it to present its rear hole. It obediently <<if $activeSlave.amp == 0>>bends over, arches its back, and<<else>>flips over and<</if>> winks its anus until you insert <<if $PC.dick == 1>>your cock<<else>>a strap-on<</if>>.
<<else>>
It can follow advanced commands, so you bring it over to your chair <<if $activeSlave.amp == 0>>and order it to squat down onto your <<if $PC.dick == 1>>cock<<else>>strap-on<</if>> and slide its anus up and down <<if $PC.dick == 1>>your<<else>>the<</if>> shaft.<<else>>and impale it on <<if $PC.dick == 1>>your cock<<else>>your strap-on<</if>>, ordering it to do its feeble best to bounce.<</if>>
<</if>>
<<if $activeSlave.fuckdoll <= 20>>
It's not fully used to having things suddenly forced up its ass, so it struggles, and its sphincter spasms deliciously.
<<elseif $activeSlave.fuckdoll <= 40>>
Aware that it is supposed to relax and accept anal rape, it does its best to accommodate the sodomy.
<<else>>
You command it to milk your <<if $PC.dick == 1>>cock<<else>>strap-on<</if>> with its asshole, and it obediently tightens its sphincter against the invading phallus rhythmically.
<</if>>
<<if $activeSlave.fuckdoll <= 60>>
<<if $activeSlave.energy > 60>>Denied any other outlet for its powerful sex drive, it orgasms.<</if>>
<<else>>
Tuned to enjoy any use by total denial of all other stimulation, it orgasms repeatedly as you fuck its anus.
<</if>>
<<if $activeSlave.voice == 0>>
Though it is mute, its breath hisses loudly <<if $activeSlave.lips > 95>>past the lips of its facepussy<<else>>through its mouth insert<</if>>.
<<else>>
It moans, <<if $activeSlave.lips > 95>>and the lips of its facepussy quiver<<else>>struggling to force the sound past its mouth insert<</if>>.
<</if>>
You climax<<if $PC.dick == 1>>, filling its rectum with your cum,<</if>> and return it to <<if $activeSlave.amp == 0>>a standing position<<else>>where it was resting<</if>>.
<<if $PC.dick == 1>>
<<if $activeSlave.anus > 2>>Your cum flows out of its gaped rear hole and down the material of its suit.
<<elseif $activeSlave.anus == 2>>Your cum drips out of its loosened rear hole and down the material of its suit.
<<else>>Its tight rear hole retains every drop of your cum.
<</if>>
The Fuckdoll will be cleaned by another slave.
<</if>>
<<if $activeSlave.anus == 0>>
<<if $activeSlave.fetish != "mindbroken">>
As you return to your business, it shakes slightly in place, and a few low moans come out of its face hole. This is probably a reaction to losing its anal virginity.
<<else>>
It gives no external indication that it's aware that it's just lost its anal virginity.
<</if>>
In any case, @@color:lime;its rear hole has been broken in.@@
<<set $activeSlave.anus = 1>>
<</if>>
<<if passage() != "Slave Interact">>
<<set _SL = $slaves.length>>
<<for _i = 0; _i < _SL; _i++>>
<<if $slaves[_i].ID == $activeSlave.ID>>
<<set $slaves[_i] = $activeSlave>>
<<break>>
<</if>>
<</for>>
<</if>>
<</widget>>
|
r3d/fc
|
src/npc/descriptions/fFuckdollWidgets.tw
|
tw
|
bsd-3-clause
| 10,459
|
:: FLips
<<nobr>>
<<set $activeSlave.oralCount++, $oralTotal++>>
You tell $activeSlave.slaveName to
<<if ($PC.dick != 0)>>
blow you with her
<<else>>
please your pussy with her
<</if>>
<<if ($activeSlave.lips > 95)>>
facepussy.
<<elseif ($activeSlave.lips > 70)>>
cartoonish lips.
<<elseif ($activeSlave.lips > 20)>>
dick-sucking lips.
<<elseif ($activeSlave.lips > 10)>>
pretty mouth.
<<else>>
whore mouth.
<</if>>
<<if ($activeSlave.fetish == "cumslut") && ($activeSlave.devotion >= -20)>>
She's delighted at the prospect of her favorite activity.
<</if>>
<<if ($activeSlave.collar == "dildo gag")>>
<<if ($activeSlave.amp != 1)>>
She removes the dildo from her throat, leaving the ring gag in place.
<<else>>
As an amputee, she requires your assistance to get the dildo out of her throat.
<</if>>
Able to breathe through her mouth for the first time in a while, she gasps gratefully, knowing the respite will be brief.
<<elseif ($activeSlave.collar == "massive dildo gag")>>
<<if ($activeSlave.amp != 1)>>
She struggles to remove the dildo from her throat, leaving her mouth agape.
<<else>>
As an amputee, she requires your assistance to get the dildo out of her throat.
<</if>>
Able to breathe through her mouth for the first time in a while, she gasps gratefully, knowing the respite will be brief.
<</if>>
<<if ($activeSlave.lipsTat == "tribal patterns")>>
The tribal patterns on her face enhance her beauty.
<<elseif ($activeSlave.lipsTat == "permanent makeup")>>
Her tattooed-on makeup encourages it.
<<elseif ($activeSlave.lipsTat == "degradation")>>
The tattoos on her face are asking for it, after all.
<</if>>
<<if ($activeSlave.lipsPiercing + $activeSlave.tonguePiercing > 2)>>
The stimulation from her many oral piercings should be great.
<<elseif ($activeSlave.lipsPiercing + $activeSlave.tonguePiercing > 0)>>
The sensation of her oral piercings should be quite nice.
<</if>>
<<if ($activeSlave.teeth == "removable")>>
<<if ($activeSlave.devotion <= 20)>>
You pull her prosthetic teeth out of her mouth so you can enjoy an extra-soft throatfuck.
<<else>>
She slides her prosthetic teeth out of her mouth so she can give you an extra-soft suck.
<</if>>
<</if>>
<<if ($activeSlave.amp == 1)>>
You set her limbless torso on the
<<if ($PC.dick != 0)>>
edge of your desk with her on her back. Her head dangles off the edge of the desk, leaving her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth at the perfect angle for use. As an amputee she has absolutely no control over the depth or quickness of oral sex, so you are careful not to hurt her. Even so, you take her to the edge of gagging, enjoying the sight of her $activeSlave.skin throat bulging. Eventually you shoot your load directly down her gullet.
<<if $PC.vagina == 1>>If she thought that was it, she's soon corrected: you hike yourself up further, and grind your pussy against her face.<</if>>
<<else>>
floor next to your desk and kneel on her with your legs on either side of her, so your pussylips are hard against her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth. She desperately eats you out, trying to get you off as fast as possible so she can get a bit more air, but you grind down without mercy, taking your pleasure.
<</if>>
<<elseif tooBigBelly($activeSlave)>>
You get her situated on the edge of your desk, on her back. This pins her down, the massive weight of her belly stopping her from going anywhere at all. Her head dangles off the edge of the desk, leaving her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth at the perfect angle for use.
<<if ($PC.dick != 0)>>
<<if $activeSlave.bellyImplant > 8000>>
She has absolutely no control over the depth or quickness of oral sex, so you are careful not to hurt her. Even so, you take her to the edge of gagging, enjoying the sight of the spasms running through her stomach as she struggles to breathe. Eventually you shoot your load directly down her gullet.
<<else>>
She has absolutely no control over the depth or quickness of oral sex, so you are careful not to hurt her. Even so, you take her to the edge of gagging, enjoying the sight of her $activeSlave.skin throat bulging and every movement within her overstuffed womb as she struggles to breathe. Eventually you shoot your load directly down her gullet.
<</if>>
<<if $PC.vagina == 1>>If she thought that was it, she's soon corrected: you hike yourself up further, and grind your pussy against her face.<</if>>
<<else>>
<<if $activeSlave.bellyImplant > 8000>>
She has absolutely no control over how hard you grind your cunt against her face, so you are careful not to suffocate her. Even so, you take her to the edge, enjoying the sight of the spasms running through her stomach as she struggles to breathe. Eventually you climax, giving her a good taste of your femcum.
<<else>>
She has absolutely no control over how hard you grind your cunt against her face, so you are careful not to suffocate her. Even so, you take her to the edge, enjoying the sight of the movement within her overstuffed womb as she struggles to breathe. Eventually you climax, giving her a good taste of your femcum.
<</if>>
<</if>>
<<elseif tooBigBreasts($activeSlave)>>
You get her situated on the edge of your desk, on her back. This pins her down, the massive weight of her tits stopping her from going anywhere at all. Her head dangles off the edge of the desk, leaving her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth at the perfect angle for use.
She has absolutely no control over
<<if ($PC.dick != 0)>>
the depth or quickness of oral sex, so you are careful not to hurt her. Even so, you take her to the edge of gagging, enjoying the sight of her $activeSlave.skin throat bulging and her absurd boobs jiggling as she struggles to breathe. Eventually you shoot your load directly down her gullet.
<<if $PC.vagina == 1>>If she thought that was it, she's soon corrected: you hike yourself up further, and grind your pussy against her face.<</if>>
<<else>>
how hard you grind your cunt against her face, so you are careful not to suffocate her. Even so, you take her to the edge, enjoying the sight of her absurd boobs jiggling as she struggles to breathe. Eventually you climax, giving her a good taste of your femcum.
<</if>>
<<elseif tooBigButt($activeSlave)>>
You get her situated on the edge of your desk, on her back. This anchors her, the massive weight of her ass stopping her from going anywhere at all. Her head dangles off the edge of the desk, leaving her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth at the perfect angle for use.
<<if ($PC.dick != 0)>>
She has absolutely no control over the depth or quickness of oral sex, so you are careful not to hurt her. Even so, you take her to the edge of gagging, enjoying the sight of her $activeSlave.skin throat bulging and her absurd rear jiggling as she struggles to breathe. Eventually you shoot your load directly down her gullet.
<<if $PC.vagina == 1>>If she thought that was it, she's soon corrected: you hike yourself up further, and grind your pussy against her face.<</if>>
<<else>>
She has absolutely no control over how hard you grind your cunt against her face, so you are careful not to suffocate her. Even so, you take her to the edge, enjoying the sight of her absurd rear jiggling as she struggles to breathe. Eventually you climax, giving her a good taste of your femcum.
<</if>>
<<elseif ($activeSlave.fetish == "cumslut") && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetishKnown == 1) && ($activeSlave.dick != 0) && ($PC.dick != 0)>>
She comes over eagerly, with hunger in her eyes. She gets to her knees, hurriedly takes you into her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth, and gives the blowjob her all. As a cumslut she's almost desperate to get your cum into her mouth and <<if ($activeSlave.dickAccessory == "chastity")>>(since her cock is off limits) frantically rubs her nipples and asspussy<<elseif ($activeSlave.hormones < 1) and ($activeSlave.balls != 0)>>jacks herself off<<else>>rubs her sadly limp member<</if>> in anticipation.<<if $PC.vagina == 1>> You have more than one variety of deliciousness for her, and she's careful not to neglect your wet cunt.<</if>> When you finish, she sits back with an ecstatic look on her face and lets your cum rest in her mouth as she climaxes into her $activeSlave.skin hand. She pours her own cum from her hand into her mouth so it can mingle with yours.
<<elseif ($activeSlave.fetish == "cumslut") && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetishKnown == 1) && ($PC.dick != 0)>>
She comes over eagerly, with hunger in her eyes. She gets to her knees, hurriedly takes you into her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth, and gives the blowjob her all. As a cumslut she's almost desperate to get your cum into her mouth and rubs herself in anticipation.<<if $PC.vagina == 1>> You have more than one variety of deliciousness for her, and she's careful not to neglect your wet cunt.<</if>> When you finish, she sits back with an ecstatic look on her face and lets your cum rest in her mouth as she climaxes.
<<elseif $activeSlave.devotion < -20>>
She tries to back away, so you
<<if ($PC.dick != 0)>>
<<if $activeSlave.collar == "dildo gag">>
She tries to back away, so you grab her; her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth is already held invitingly open by her gag, and she's prevented from biting. You push her down to her knees with her head against the couch next to your desk so you can give her a good hard throat fuck. When you cum down her $activeSlave.skin throat she retches through her tears.
<<elseif $activeSlave.collar == "massive dildo gag">>
She tries to back away, so you grab her; her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth is left agape, unable to close after being forced so widely open for so long, so she is unlikely to bite. You push her down to her knees with her head against the couch next to your desk so you can give her a good hard throat fuck. When you cum down her $activeSlave.skin throat she retches through her tears.
<<else>>
grab her and force a ring gag into her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth. Once you have the straps secured behind her head, she's prevented from biting. You push her down to her knees with her head against the couch next to your desk so you can give her a good hard throat fuck. When you cum down her $activeSlave.skin throat she retches through her tears.
<<if $PC.vagina == 1>>She has a mere moment to get her breath back before you press your pussy against her unwilling mouth.<</if>>
<</if>>
<<else>>
seize her and throw her onto the couch face up, and then kneel on her with your legs on either side of her crying body, so your pussylips are hard against her <<if $seeRace == 1>>$activeSlave.race <</if>>mouth. She desperately eats you out, trying to get you off as fast as possible so she can get a bit more air, but you grind down without mercy, taking your pleasure.
<</if>>
<<elseif $activeSlave.devotion <= 20>>
She comes over reluctantly and begins to
<<if ($PC.dick != 0)>>
give you a blowjob. Deciding that she isn't showing the necessary enthusiasm, you hold her head and fuck her <<if $seeRace == 1>>$activeSlave.race <</if>>face instead<<if $PC.vagina == 1>>, occasionally jerking your dick free to shove your pussy against her face instead<</if>>. She does her best to follow your motions but still splutters and gags. You pull free to cum across her $activeSlave.skin face and hair.
<<else>>
eat you out. Deciding that she isn't showing the necessary enthusiasm, you hold her head and grind your pussy against her <<if $seeRace == 1>>$activeSlave.race <</if>>face instead. She does her best to follow your motions but still splutters and gasps for air. You climax quickly and haul her to her feet, kissing the bewildered girl full on the mouth. You can taste yourself on her lips.
<</if>>
<<else>>
She licks her lips and looks you in the eyes as she gets to her knees. She
<<if ($PC.dick != 0)>>
gives you a long, deep blowjob. She massages your balls<<if $PC.vagina == 1>> and pussy<</if>> with one hand and her breasts with the other, giving you a show. She sucks your head until you climax, letting your cock pop free of her mouth to shoot pearly cum all across her $activeSlave.skin face.
<<else>>
eats you out like she's starving, moaning into your pussy to show off her arousal and add to your pleasure. She massages your perineum with one hand and her breasts with the other, giving you a show. She slowly concentrates more and more attention on your clit until you climax convulsively. You pull her to her feet, kissing the compliant girl full on the mouth. You can taste yourself on her lips.
<</if>>
<</if>>
<<if ($activeSlave.teeth == "pointy") || ($activeSlave.teeth == "straightening braces") || ($activeSlave.teeth == "cosmetic braces")>>
<<if ($activeSlave.oralSkill >= 100)>>
She's so orally skilled that she had the confidence to lightly graze you with her <<if ($activeSlave.teeth == "pointy")>>sharp teeth<<else>>braces<</if>> on occasion, a delightfully scary sensation.
<<elseif ($activeSlave.oralSkill > 30)>>
She's sufficiently orally skilled that she managed to accomplish all that without her <<if ($activeSlave.teeth == "pointy")>>sharp teeth<<else>>braces<</if>> contacting your<<if ($PC.dick == 1)>>dick<<else>>pussy<</if>> once.
<<elseif ($activeSlave.oralSkill > 10)>>
With her basic oral skills, she accidentally grazed you with her <<if ($activeSlave.teeth == "pointy")>>sharp teeth<<else>>braces<</if>> a few times, leaving your <<if ($PC.dick == 1)>>dick<<else>>pussy<</if>> slightly the worse for wear.
<<else>>
Since she is orally unskilled, you were sporting with your <<if ($PC.dick == 1)>>dick<<else>>pussy<</if>> by using her mouth. She did her best to keep her <<if ($activeSlave.teeth == "pointy")>>sharp teeth<<else>>braces<</if>> off you, but you're bleeding a bit down there.
<</if>>
<</if>>
<<if ($economy <= 1)>>
<<if (random(1,100) > (100 + $activeSlave.devotion))>>
<<if ($activeSlave.fetish != "cumslut") && ($activeSlave.energy <= 95) && ($activeSlave.sexualFlaw != "hates oral")>>
Being facefucked by force has given her a @@color:red;hatred of oral sex.@@
<<set $activeSlave.sexualFlaw = "hates oral">>
<</if>>
<<elseif (random(1,100) > (110 - $activeSlave.devotion))>>
<<if ($PC.dick == 1) && ($activeSlave.fetish == "none") && ($activeSlave.sexualFlaw != "hates oral")>>
Consummating an enjoyable sexual encounter by drinking your cum has @@color:lightcoral;encouraged her to focus on oral sex.@@
<<set $activeSlave.fetish = "cumslut", $activeSlave.fetishKnown = 1>>
<</if>>
<</if>>
<</if>>
<<if passage() != "Slave Interact">>
<<set _SL = $slaves.length>>
<<for _i = 0; _i lt _SL; _i++>>
<<if $slaves[_i].ID == $activeSlave.ID>>
<<set $slaves[_i] = $activeSlave>>
<<break>>
<</if>>
<</for>>
<</if>>
<</nobr>>
|
r3d/fc
|
src/npc/descriptions/fLips.tw
|
tw
|
bsd-3-clause
| 15,028
|
:: FVagina
<<nobr>>
You call her over so you can
<<if ($activeSlave.vagina == 10)>>
tickle her cavernous hole.
<<elseif ($activeSlave.vagina > 3)>>
use her gaping vagina.
<<elseif ($activeSlave.vagina == 3)>>
fuck her loose cunt.
<<elseif ($activeSlave.vagina == 2)>>
fuck her whorish cunt.
<<elseif ($activeSlave.vagina == 1)>>
fuck her tight cunt.
<<elseif ($activeSlave.vagina == 0)>>
take her virginity.
<<else>>
fuck her sissy butt.
<</if>>
<<if ($activeSlave.vaginaTat == "tribal patterns")>>
The tattoos on her abdomen certainly drawn attention there.
<<elseif ($activeSlave.vaginaTat == "scenes")>>
The tattoos on her abdomen nicely illustrate what you mean to do to her.
<<elseif ($activeSlave.vaginaTat == "degradation")>>
The tattoos on her abdomen ask you to, after all.
<</if>>
<<if $activeSlave.devotion <= 20>>
<<if $activeSlave.clit == 1>>
Her big clit peeks out from under its hood.
<<elseif $activeSlave.clit == 2>>
Her huge clit is impossible to miss.
<<elseif $activeSlave.clit > 2>>
Her pseudophallus-sized clit is soft.
<</if>>
<<if $activeSlave.labia == 1>>
Her lovely petals are quite inviting.
<<elseif $activeSlave.labia == 2>>
Her prominent petals are inviting.
<<elseif $activeSlave.labia > 2>>
Her labia are so large they present a slight obstacle to entry.
<</if>>
<<else>>
<<if $activeSlave.clit == 1>>
Her big, hard clit peeks out from under its hood.
<<elseif $activeSlave.clit == 2>>
Her huge, stiff clit is impossible to miss.
<<elseif $activeSlave.clit > 2>>
Her pseudophallus-sized clit is engorged with arousal.
<</if>>
<<if $activeSlave.labia == 1>>
Her lovely petals are moist with arousal.
<<elseif $activeSlave.labia == 2>>
Her prominent petals bear a sheen of arousal.
<<elseif $activeSlave.labia > 2>>
Her huge labia are almost dripping with arousal.
<</if>>
<</if>>
<<if ($activeSlave.vaginaPiercing > 1)>>
<<if ($activeSlave.vagina != -1)>>
Her pierced lips and clit have her nice and wet.
<</if>>
<<if ($activeSlave.dick != 0)>>
Metal glints all up and down her cock.
<</if>>
<<elseif ($activeSlave.vaginaPiercing == 1)>>
<<if ($activeSlave.vagina != -1)>>
Her pierced clit has her nice and moist.
<</if>>
<<if ($activeSlave.dick != 0)>>
Metal glints at the head of her cock.
<</if>>
<</if>>
<<set _fPosition = random(1,100) && canWalk($activeSlave)>>
You decide to fuck her
<<if (_fPosition <= 20)>>
in the missionary position. You tell her to lie down on the couch next to your desk.<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>> A position that will difficult due to her massive pregnancy.<<elseif $activeSlave.bellyImplant >= 16000>> A position that will difficult due to her massive stomach.<</if>>
<<elseif (_fPosition <= 40)>>
doggy-style. You tell her to get on the couch beside your desk on her hands and knees.<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>> A position that leaves her rear high in the air thanks to her massive pregnancy.<<elseif $activeSlave.bellyImplant >= 16000>> A position that leaves her rear high in the air thanks to her massive stomach.<</if>>
<<elseif (_fPosition <= 60)>>
in the cowgirl position. You lie on the couch beside your desk and tell her to straddle you, facing towards you.<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>> A position that will allow you to tease her massive pregnancy as you fuck her.<<elseif $activeSlave.bellyImplant >= 16000>> A position that will allow you to tease her massive belly as you fuck her.<</if>>
<<elseif (_fPosition <= 80)>>
in the reverse cowgirl position. You lie on the couch beside your desk and tell her to straddle you facing away from you.<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>> A position that will much more comfortable due for her massive pregnancy.<<elseif $activeSlave.bellyImplant >= 16000>> A position that will much more comfortable for her massive belly.<</if>>
<<else>>
in the wheelbarrow position. You tell her to get on the couch beside your desk, stand next to her and lift her legs up into the air.<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>> You hope you don't strain something supporting her massive pregnancy.<<elseif $activeSlave.bellyImplant >= 16000>> You hope you don't strain something supporting her massive belly.<</if>>
<</if>>
<<set _fSpeed = random(1,100)>>
<<if ($activeSlave.vagina == 0) && ($activeSlave.vaginalAccessory != "chastity belt")>>
<<if ($activeSlave.fetish == "mindbroken")>>
She accepts your orders dumbly and presents her virgin pussy for defloration<<if ($PC.dick == 0)>>, watching without real interest as you don a strap-on<</if>>. Since she is mindbroken, @@color:lime;losing her virginity@@ has no impact on any part of her other than her vagina.
<<elseif ($activeSlave.devotion > 20)>>
She accepts your orders without comment and presents her virgin pussy for defloration<<if ($PC.dick == 0)>>, watching with some small trepidation as you don a strap-on<</if>>. You gently ease into her pussy before gradually increasing the intensity of your thrusts into her. Before long, she's moaning loudly as you pound away. Since she is already well broken, this new connection with her <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>master<<else>>mistress<</if>> @@color:hotpink;increases her devotion to you.@@ @@color:lime;Her pussy has been broken in.@@ She looks forward to having her pussy fucked by you again.
<<set $activeSlave.devotion += 10>>
<<elseif ($activeSlave.devotion >= -20)>>
She is clearly unhappy at losing her pearl of great price to you; this probably isn't what she imagined her first real sex would be like.<<if ($PC.dick == 0)>>Her lower lip quivers with trepidation as she watches you don a strap-on and maneuver to fuck her virgin hole.<</if>> You gently ease into her pussy before gradually increasing the intensity of your thrusts into her. Before long, she's moaning as you pound away. Nevertheless, this new connection with her <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>master<<else>>mistress<</if>> @@color:hotpink;increases her devotion to you.@@ @@color:lime;Her pussy has been broken in,@@ and she is @@color:gold;fearful@@ that sex will continue to be painful.
<<set $activeSlave.devotion += 4, $activeSlave.trust -= 4>>
<<else>>
As you anticipated, she refuses to give you her virginity. And as you expected, she is unable to resist you. She cries as <<if ($PC.dick == 0)>>your strap-on<<else>>your cock<</if>> opens her fresh, tight hole. You force your way into her pussy and continue thrusting into her. She sobs and cries with horror as you pound away. The rape @@color:mediumorchid;decreases her devotion to you.@@ @@color:lime;Her pussy has been broken in,@@ and she @@color:gold;fears further abuse.@@
<<set $activeSlave.devotion -= 4, $activeSlave.trust -= 4>>
<</if>>
<<set $activeSlave.vagina++>>
<<elseif ($activeSlave.fetish == "mindbroken")>>
Since her mind is gone, she's yours to use as a human sex doll. You throw her over the couch and amuse yourself with her for a while; her body retains its instinctual responses, at least. You finish inside her and leave your toy for one of your other slaves to clean and maintain.
<<elseif ($activeSlave.amp == 1)>>
Since she's a quadruple amputee, she's yours to use as a human sex toy. You set her
<<if ($PC.dick != 0)>>
atop your cock and slide her up and down, managing her with your arms.
<<if $activeSlave.dickAccessory == "chastity">>
Her dick chastity keeps her useless bitchclit out of the way.
<<elseif ($activeSlave.vagina == -1) && ($activeSlave.hormones > 0) && ($activeSlave.balls != 0)>>
As you use her as a helpless cock jacket, her flaccid dick flops around, ignored.
<<elseif ($activeSlave.vagina == -1)>>
As you use her as a helpless cock jacket, your pounding keeps her prick stiff.
<</if>>
You finish inside her and leave your toy for one of your other slaves to clean and maintain.
<<else>>
on the couch and straddle her hips, bringing your already-wet pussy hard against her. You grind against her helpless body, using her as a living sybian until her warmth and movement brings you to orgasm.
<</if>>
<<elseif !canWalk($activeSlave) && tooBigBelly($activeSlave)>>
You tell her to get situated on the couch, face down. This position pins her down by the massive weight of her belly, pushing her face in amongst the cushions and keeping her crotch in the ideal position to penetrate. Her belly serves as an anchor, allowing you to take her doggy style without any real contribution from her. The position muffles her reaction entirely, other than the rhythmic jiggling of her bulging belly that sticks out from either side of her torso.
<<elseif !canWalk($activeSlave) && tooBigBreasts($activeSlave)>>
You tell her to get situated on the couch, face down. This position pins her down by the massive weight of her tits, pushing her face in amongst the cushions. Her tits serve as an anchor, allowing you to take her doggy style without any real contribution from her. The position muffles her reaction entirely, other than the rhythmic jiggling of the breastflesh that sticks out to either side of her torso.
<<elseif !canWalk($activeSlave) && tooBigButt($activeSlave)>>
You tell her to get situated on the couch, face up. This position pins her down by the massive weight of her rear, causing her to sink into the cushions. Her ass serves as an anchor, allowing you to take her missionary style without any real contribution from her. This position lets you clearly see her reaction, as well as the rhythmic jiggling of the buttflesh that sticks out to either side of her hips.
<<elseif !canWalk($activeSlave) && tooBigBalls($activeSlave)>>
You tell her to get situated on the couch, doggy style. This position pins her down by the massive weight of her balls. Her testicles serve as an anchor, allowing you to take her doggy style without any real worry of getting struck by her massive nuts. The position keeps her balls completely still where they rest on the couch, so yo don't have to worry about them getting in the way.
<<elseif ($activeSlave.fetish == "submissive") && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetishKnown == 1) && ($PC.dick != 0)>>
She comes over, smiling a little submissive smile, and spreads herself for you. You take her on the couch next to your desk after she gets into position.
<<if (_fPosition <= 20)>>
<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>
You have to heft her gravid body up to position yourself for penetration. But once you are mounted, you rest your head against her bulging belly and feel the movements within as you thrust into her;
<<elseif $activeSlave.bellyImplant >= 16000>>
You have to heft her weighty body up to position yourself for penetration. But once you are mounted, you rest your head against her massive stomach and feel the force of your thrusts running through her;
<<else>>
She hugs her torso to you and her breasts press against your chest;
<</if>>
<<elseif (_fPosition <= 40)>>
<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>
She arches her back as you continue to pound her, her occupants enjoying the attention. As you rest your weight on her, you run your hands along her distended sides;
<<elseif $activeSlave.bellyImplant >= 16000>>
She arches her back as you continue to pound her, her belly jiggling just slightly with each thrust. As you rest your weight on her, you run your hands along her distended sides;
<<else>>
She arches her back as you continue to pound her;
<</if>>
<<elseif (_fPosition <= 60)>>
<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>
She does her best to not suffocate you with her massive pregnancy or knock you out with it as you thrust into her. You get a face full of pregnancy with each downward motion;
<<elseif $activeSlave.bellyImplant >= 16000>>
She does her best to not suffocate you with her massive belly or knock you out with it as you thrust into her. You get a face full of implant with each downward motion;
<<else>>
She puts her hands on your chest and leans forward as you continue to thrust upwards;
<</if>>
<<elseif (_fPosition <= 80)>>
<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>
You may have to spread your legs extra wide to accommodate her impressive baby bump, but the angle and pressure it puts on you feels amazing. She puts her hands on your chest and starts to lean back as you continue to thrust upwards, in return you caress her distended sides;
<<elseif $activeSlave.bellyImplant >= 16000>>
You may have to spread your legs extra wide to accommodate her impressive belly, but the angle and pressure it puts on you feels amazing. She puts her hands on your chest and starts to lean back as you continue to thrust upwards, in return you caress her distended sides;
<<else>>
She puts her hands on your chest starts to lean back as you continue to thrust upwards;
<</if>>
<<else>>
<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>
Before long both of your strength begins to wane, causing her belly to touch the floor. With some of the weight off of the both of you, you keep on pounding;
<<elseif $activeSlave.bellyImplant >= 16000>>
Before long both of your strength begins to wane, causing her belly to touch the floor. With some of the weight off of the both of you, you keep on pounding;
<<else>>
She begins to tire as you keep pounding;
<</if>>
<</if>>
you can feel <<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>her children begin to squirm in reaction to their mother's lust<<else>>her heart beating hard<</if>>. As the sex reaches its climax, she begs you to cum inside her unworthy body.
<<if ($activeSlave.dick != 0) && canAchieveErection($activeSlave)>>
<<if $activeSlave.dickAccessory == "chastity">>
She does her submissive best to stay completely soft within her dick chastity.
<<else>>
As a submissive she spares no attention for her own orgasm, so her rock hard erection swings untended.
<</if>>
<<elseif ($activeSlave.dickAccessory == "chastity")>>
Her cock is forgotten inside its chastity cage as you take what you want from her.
<<elseif ($activeSlave.dick != 0)>>
As a submissive she spares no attention for her own orgasm, so her flaccid cock swings untended.
<</if>>
<<if $PC.vagina == 1>>
When you finally climax, you pull out and press your wet cunt against her mouth, letting her lavish attention on you that brings you to another quick orgasm.
<<set $activeSlave.oralCount += 1>>
<<set $oralTotal += 1>>
<</if>>
<<elseif $activeSlave.devotion < -20>>
She tries to refuse, so you
<<if ($PC.dick != 0)>>
bend the disobedient slave over your desk and take her hard from behind. Her breasts <<if ($activeSlave.dick != 0)>>and cock <</if>>slide back and forth across the desk. You give her buttocks some nice hard swats as you pound her. She grunts and moans but knows better than to try to get away.
<<if ($activeSlave.dick != 0) && canAchieveErection($activeSlave)>>
Despite her unwillingness to be raped, the stimulation
<<if $activeSlave.dickAccessory == "chastity">>
starts to give her an erection, which her dick chastity makes horribly uncomfortable. She bucks with the pain, her hole spasming delightfully.
<<else>>
gives her an erection. She's mortified that she would get hard while being raped.
<</if>>
<<elseif ($activeSlave.dickAccessory == "chastity")>>
Her dick chastity keeps her bitch cock hidden away while you use her whore hole.
<<elseif ($activeSlave.dick != 0)>>
Her flaccid dick is ground into the back of the couch as you rape her.
<</if>>
<<if $PC.vagina == 1>>
After your first orgasm, you pull out and grind your pussy against her face for another, enjoying the stimulation of her muffled crying.
<<set $activeSlave.oralCount += 1>>
<<set $oralTotal += 1>>
<</if>>
<<else>>
stand and seize her, shoving her down to sit in your chair. You jump atop her hips, pinning her down into the chair with your legs and pressing your pussy hard against her groin. She struggles and whimpers, but you give her a hard warning slap to the cheek and kiss her unwilling mouth, forcing your tongue past her lips as you grind against her.
<</if>>
<<elseif $activeSlave.devotion <= 20>>
<<if ($PC.dick != 0)>>
She obeys, lying on the couch next to your desk with her legs spread. You kneel on the ground and enter her, a hand on each of her legs to give you a good grip. <<if _fSpeed > 75>>The pounding is hard and fast<<elseif _fSpeed > 50>>You pound her firmly and vigorously<<elseif _fSpeed > 25>>You fuck her steadily and controlled<<else>>You fuck her slowly and tenderly<</if>>, and she gasps and <<if _fSpeed > 50>>whines<<else>>moans<</if>>. You reach a hand down to maul her breasts.
<<if ($activeSlave.dick != 0) && canAchieveErection($activeSlave)>>
<<if ($activeSlave.dickAccessory == "chastity")>>
She enjoys herself, even though her dick chastity keeps her soft by making the beginnings of erection very uncomfortable.
<<else>>
She bites her lip and moans as she climaxes. You fill her squeezing fuckhole with your cum. She already dribbled her own weak load all over her stomach.
<</if>>
<<elseif ($activeSlave.dickAccessory == "chastity")>>
She bites her lip and moans as she climaxes. You fill her squeezing fuckhole with your cum. Precum has been dribbling out of her dick chastity for some time, apparently the best her soft bitchclit can manage.
<<elseif ($activeSlave.dick != 0)>>
She bites her lip and moans as she climaxes. You fill her squeezing fuckhole with your cum. She already blew her own load all over her stomach despite her inability to get hard.
<</if>>
<<if $PC.vagina == 1>>
You got so wet fucking her that when you climax, you stand up and let her clean your pussy with her mouth. The oral attention brings you to a quick aftershock orgasm.
<<set $activeSlave.oralCount += 1>>
<<set $oralTotal += 1>>
<</if>>
<<else>>
You pat the tops of your thighs, and she obediently comes over to sit atop them, wrapping her legs around you. Your hands reach around her and seize her buttocks, drawing her in even closer so that the warmth between her legs is pressed hard against your pussy. She grinds dutifully against you, only pausing for a moment when she finds your insistent tongue probing past her lips.
<</if>>
<<else>>
<<if ($PC.dick != 0)>>
She skips over smiling and gives you a quick kiss. You take her on the couch next to your desk after she gets into position.
<<if (_fPosition <= 20)>>
<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>
You have to heft her gravid body up to position yourself for penetration. But once you are mounted, you rest your head against her bulging belly and feel the movements within as you thrust into her;
<<elseif $activeSlave.bellyImplant >= 16000>>
You have to heft her weighty body up to position yourself for penetration. But once you are mounted, you rest your head against her massive stomach and feel the force of your thrusts running through her;
<<else>>
She hugs her torso to you and her breasts press against your chest;
<</if>>
<<elseif (_fPosition <= 40)>>
<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>
She arches her back as you continue to pound her, her occupants enjoying the attention. As you rest your weight on her, you run your hands along her distended sides;
<<elseif $activeSlave.bellyImplant >= 16000>>
She arches her back as you continue to pound her, her belly jiggling just slightly with each thrust. As you rest your weight on her, you run your hands along her distended sides;
<<else>>
She arches her back as you continue to pound her;
<</if>>
<<elseif (_fPosition <= 60)>>
<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>
She does her best to not suffocate you with her massive pregnancy or knock you out with it as you thrust into her. You get a face full of pregnancy with each downward motion;
<<elseif $activeSlave.bellyImplant >= 16000>>
She does her best to not suffocate you with her massive belly or knock you out with it as you thrust into her. You get a face full of implant with each downward motion;
<<else>>
She puts her hands on your chest and leans forward as you continue to thrust upwards;
<</if>>
<<elseif (_fPosition <= 80)>>
<<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>
You may have to spread your legs extra wide to accommodate her impressive baby bump, but the angle and pressure it puts on you feel amazing. She puts her hands on your chest and starts to lean back as you continue to thrust upwards, in return you caress her distended sides;
<<elseif $activeSlave.bellyImplant >= 16000>>
You may have to spread your legs extra wide to accommodate her impressive belly, but the angle and pressure it puts on you feels amazing. She puts her hands on your chest and starts to lean back as you continue to thrust upwards, in return you caress her distended sides;
<<else>>
She puts her hands on your chest starts to lean back as you continue to thrust upwards;
<</if>>
<<else>>
<<if ($activeSlave.preg > 30 && $activeSlave.pregType >= 10) || ($activeSlave.bellyImplant >= 16000)>>
Before long both of your strength begins to wane, causing her belly to touch the floor. With some of the weight off of the both of you, you keep on pounding;
<<else>>
She begins to tire as you keep pounding;
<</if>>
<</if>>
you can feel <<if $activeSlave.preg > 30 && $activeSlave.pregType >= 10>>her children begin to squirm in reaction to their mother's lust<<else>>her heart beating hard<</if>>. As the sex reaches its climax, her kisses grow urgent and passionate.
<<if ($activeSlave.dick != 0) && canAchieveErection($activeSlave)>>
<<if $activeSlave.dickAccessory == "chastity">>
She enjoys herself, even though her dick chastity keeps her soft by making the beginnings of erection very uncomfortable.
<<else>>
When you orgasm together, her erect cock squirts cum up towards her tits while your cock fills her with cum.
<</if>>
<<elseif ($activeSlave.dickAccessory == "chastity")>>
She bites her lip and moans as she climaxes. You fill her squeezing fuckhole with your cum. Precum has been dribbling out of her dick chastity for some time, apparently the best her soft bitchclit can manage.
<<elseif ($activeSlave.dick != 0)>>
When you orgasm together, her limp, neglected cock dribbles weakly while your cock fills her with cum.
<<elseif ($activeSlave.clit > 2)>>
As you fuck her, she plays with her huge clit. It's so large it almost looks like she's jacking off a cock.
<</if>>
<<if $PC.vagina == 1>>
You got so wet fucking her that when you climax, you stand up; she knows what that means, and hurries to eat you out. The oral attention brings you to a quick aftershock orgasm.
<<set $activeSlave.oralCount += 1>>
<<set $oralTotal += 1>>
<</if>>
<<else>>
You pat the tops of your thighs, and she skips over smiling and gives you a quick kiss. Without breaking the lip lock, she sits down, wrapping her legs around you. Your hands reach around her and seize her buttocks, drawing her in even closer so that the warmth between her legs is pressed hard against your pussy, and you can play with her asshole. She grinds enthusiastically against you, moaning into your mouth with pleasure.
<</if>>
<</if>>
<<if ($activeSlave.vagina >= 0) && ($activeSlave.vaginalAccessory != "chastity belt")>>
<<VaginalVCheck>>
<<else>>
<<AnalVCheck>>
<</if>>
<<if ($activeSlave.preg > 10)>>
The poor slave's belly gets in the way, but the added perversion of fucking a pregnant hole makes the inconvenience worthwhile.
<<elseif ($activeSlave.inflation > 0)>>
The poor slave's sloshing belly gets in the way, but the added perversion of seeing it jiggle makes the inconvenience worthwhile.
<<elseif ($activeSlave.bellyImplant >= 2000)>>
The poor slave's implant filled belly gets in the way, but the added perversion of fucking a girl with such a round stomach makes the inconvenience worthwhile.
<</if>>
<<if (random(1,100) > (100 + $activeSlave.devotion))>>
<<if ($activeSlave.fetish != "pregnancy") && ($activeSlave.energy <= 95) && ($activeSlave.sexualFlaw != "hates penetration")>>
Being taken by force has given her a @@color:red;hatred of penetration.@@
<<set $activeSlave.sexualFlaw = "hates penetration">>
<</if>>
<<elseif (random(1,100) > (110 - $activeSlave.devotion))>>
<<if ($activeSlave.fetish == "none") && ($activeSlave.energy <= 95) && ($activeSlave.sexualFlaw != "hates penetration")>>
Enjoying sex with you seems to have @@color:lightcoral;encouraged her biological clock.@@
<<set $activeSlave.fetish = "pregnancy", $activeSlave.fetishKnown = 1, $activeSlave.fetishStrength = 10>>
<</if>>
<</if>>
<<if ($PC.dick != 0)>>
<<if $activeSlave.cervixImplant == 1>>
<<set $activeSlave.bellyImplant += random(10,20)>>
<</if>>
<<if ($activeSlave.vagina == 3)>>
Cum drips out of her fucked-out hole.
<<elseif ($activeSlave.vagina == 2)>>
Cum drips out of her stretched vagina.
<<elseif ($activeSlave.vagina == 1)>>
Her still-tight vagina keeps your load inside her.
<<elseif ($activeSlave.vagina < 0)>>
Cum drips out of her girly ass.
<<else>>
Your cum slides right out of her gaping hole.
<</if>>
<<if (canWalk($activeSlave) == true)>>
She uses <<if $activeSlave.vagina > 0>>a quick douche to clean her <<if $activeSlave.vagina < 2>>tight<<elseif $activeSlave.vagina > 3>>loose<</if>> pussy<<else>>an enema to clean her <<if $activeSlave.anus < 2>>tight<<elseif $activeSlave.anus < 3>>used<<else>>gaping<</if>> butthole<</if>>,
<<switch $activeSlave.assignment>>
<<case "work in the brothel">>
just like she does between each customer.
<<case "serve in the club">>
just like she does in the club.
<<case "work in the dairy">>
to avoid besmirching the nice clean dairy.
<<case "work as a servant">>
mostly to keep everything she has to clean from getting any dirtier.
<<case "whore">>
before returning to offering it for sale.
<<case "serve the public">>
before returning to offering it for free.
<<case "rest">>
before crawling back into bed.
<<case "get milked">>
<<if $activeSlave.lactation > 0>>before going to get her uncomfortably milk-filled tits drained<<else>>and then rests until her balls are ready to be drained again<</if>>.
<<case "be a servant">>
since her chores didn't perform themselves while you used her fuckhole.
<<case "please you">>
before returning to await your next use of her fuckhole, as though nothing had happened.
<<case "be a subordinate slave">>
though it's only a matter of time before another slave decides to play with her fuckhole.
<<case "be your Head Girl">>
worried that her charges got up to trouble while she enjoyed her <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>Master<<else>>Mistress<</if>>'s use.
<<case "guard you">>
so she can be fresh and ready for more sexual use even as she guards your person.
<<case "train slaves">>
before she returns to teaching her classes.
<<default>>
before she returns to $activeSlave.assignment.
<</switch>>
<</if>>
<</if>>
<<if passage() != "Slave Interact">>
<<set _SL = $slaves.length>>
<<for _i to 0; _i < _SL; _i++>>
<<if $slaves[_i].ID == $activeSlave.ID>>
<<set $slaves[_i] = $activeSlave>>
<<break>>
<</if>>
<</for>>
<</if>>
<</nobr>>
|
r3d/fc
|
src/npc/descriptions/fVagina.tw
|
tw
|
bsd-3-clause
| 27,619
|
:: FAbuse
<<nobr>>
<<if ($activeSlave.ID is $Bodyguard.ID)>>
<<if ($activeSlave.fetish is "masochist") && ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 95)>>
Knowing how much your bodyguard likes being hurt, you decide to reward her in her own particular way.
<<elseif ($activeSlave.muscles == 0) and ($activeSlave.combatSkill == 0)>>
Looking at your bodyguard, you think she doesn't seem that dangerous, as she can barely hold a weapon up. You order her to spar with you, and you quickly overpower her without even breaking a sweat. Afterwards, you take the pretext of punishing her to satisfy your urges.
<<elseif ($activeSlave.muscles == 0) and ($activeSlave.combatSkill != 0)>>
You glance at your bodyguard. She looks like she can handle herself, and you know she does, but her lack of musculature makes her look somewhat frail. You inform her that she isn't muscular enough, and that you'll punish her youself for neglecting her physique.
<<elseif ($activeSlave.muscles != 0) and ($activeSlave.combatSkill == 0)>>
Your bodyguard may look strong and powerful, you know she can't really handle her weapon. You order her to spar with you, and you use her own muscles against her, winning eaisly. Afterwards, you take the pretext of punishing her to satisfy your urges.
<<elseif ($activeSlave.muscles != 0) and ($activeSlave.combatSkill != 0)>>
Your bodyguard stands at your side. She is definetely a force to be reckoned with. You know you'd have a hard time besting her, and do not wish to get hurt, so you'll just inform her she'll be undertaking some particular training.
<</if>>
<</if>>
<<set _asspain to 0>>
<<if ($activeSlave.amp is 1)>>
You set her helpless form down for abuse. Brutalizing her is almost childishly easy; her limbless torso leaves her at your mercy.
<<else>>
You call her over so you can abuse the <<if $seeRace is 1>>$activeSlave.race <</if>>bitch. You get things started with an open-handed slap across the face<<if !canSee($activeSlave)>>; she never saw it coming<</if>>. As she reels in shock and pain, you follow up with
<<if ($activeSlave.preg > 30) and ($activeSlave.pregType >= 20)>>
a vicious slap across her straining pregnant belly,
<<elseif ($activeSlave.inflation > 0)>>
a vicious punch into her bloated belly,
<<elseif ($activeSlave.dick > 0)>>
a vicious slap to her cock,
<<elseif ($activeSlave.clit gt 0)>>
a vicious slap to her exposed clit,
<<elseif ($activeSlave.nipples is "huge")>>
a vicious jerk on her big nipples,
<<elseif ($activeSlave.nipples is "inverted")>>
a vicious pinch to each side of her sensitive, fully inverted nipples,
<<elseif ($activeSlave.preg > 30) && ($activeSlave.pregType >= 10)>>
a vicious slap across her overfull pregnant belly,
<<elseif ($activeSlave.preg > 10)>>
a vicious slap across her pregnant belly,
<<elseif ($activeSlave.heels gt 0)>>
a vicious thrust to her altered tendons,
<<elseif ($activeSlave.boobs gte 800)>>
a vicious slap across her massive breasts,
<<elseif ($activeSlave.bellyImplant >= 2000)>>
a vicious slap across her implant rounded belly,
<<elseif ($activeSlave.vaginalAccessory != "chastity belt")>>
a vicious slap on the mons,
<<else>>
a vicious jerk on her nipples,
<</if>>
<<if $activeSlave.inflation == 3>>
<<if $activeSlave.inflationMethod == 2>>
which causes her to discharge her contained $activeSlave.inflationType all over herself before collapsing into her puddle on the floor in agony.
<<set $activeSlave.inflation to 0, $activeSlave.inflationType to "none", $activeSlave.inflationMethod to 0, $activeSlave.cumSource = 0, $activeSlave.milkSource = 0>>
<<else>>
which causes her to vomit up her contained $activeSlave.inflationType all over herself before collapsing into her puddle on the floor in agony.
<<set $activeSlave.inflation to 0, $activeSlave.inflationType to "none", $activeSlave.inflationMethod to 0, $activeSlave.cumSource = 0, $activeSlave.milkSource = 0>>
<</if>>
<<elseif $activeSlave.inflation == 2>>
<<if random(1,100) > $activeSlave.devotion>>
which nearly forces her to lose her contained $activeSlave.inflationType, but she controls herself out of devotion to you as she drops to the floor in agony.
<<else>>
<<if $activeSlave.inflationMethod == 2>>
which causes her to discharge her contained $activeSlave.inflationType all over herself before collapsing into her puddle on the floor in agony.
<<set $activeSlave.inflation to 0, $activeSlave.inflationType to "none", $activeSlave.inflationMethod to 0, $activeSlave.cumSource = 0, $activeSlave.milkSource = 0>>
<<else>>
which causes her to vomit up her contained $activeSlave.inflationType all over herself before collapsing into her puddle on the floor in agony.
<<set $activeSlave.inflation to 0, $activeSlave.inflationType to "none", $activeSlave.inflationMethod to 0, $activeSlave.cumSource = 0, $activeSlave.milkSource = 0>>
<</if>>
<</if>>
<<else>>
which causes her to collapse to the floor in agony.
<</if>>
<<if ($activeSlave.clothes isnot "no clothing")>>
You tell her she has ten seconds to get naked.
<</if>>
<<if ($activeSlave.clothes is "uncomfortable straps")>>
In her haste to get out of her straps she trips and falls flat.
<<elseif ($activeSlave.clothes is "clubslut netting")>>
In her haste to get out of her slutty netting she trips and falls flat.
<<elseif ($activeSlave.clothes is "shibari ropes")>>
In her haste to get out of her shibari ropes she only manages to get tangled and fall over.
<<elseif ($activeSlave.clothes is "restrictive latex") or ($activeSlave.clothes is "a latex catsuit")>>
In her haste to get out of her clinging latex she trips and falls flat in a tangle of latex and trembling flesh.
<<elseif ($activeSlave.clothes is "a military uniform")>>
She's desperately torn between hurry to avoid punishment and fear she'll damage her shirt.
<<elseif ($activeSlave.clothes is "a nice nurse outfit")>>
She quickly tears off her loose scrubs.
<<elseif ($activeSlave.clothes is "a mini dress")>>
She struggles to take off her tight mini dress.
<<elseif ($activeSlave.clothes is "attractive lingerie")>>
She almost tears her delicate lingerie in her haste to avoid punishment.
<<elseif ($activeSlave.clothes is "a succubus outfit")>>
She struggles with her leather corset.
<<elseif ($activeSlave.clothes is "attractive lingerie for a pregnant woman")>>
She quickly sheds her vest and tight bra before panicking and resorting to ripping her silk panties off.
<<elseif ($activeSlave.clothes is "a maternity dress")>>
She hastily pulls her dress down revealing her body.
<<elseif ($activeSlave.clothes is "a cheerleader outfit")>>
She yanks her cheerleader skirt down and pulls her slutty top off.
<<elseif ($activeSlave.clothes is "a string bikini")>>
She gives herself a nasty pinch between the legs in her haste to get out of her string bottom.
<<elseif ($activeSlave.clothes is "a fallen nuns habit")>>
She tugs desperately at the laces of her tight latex nun getup.
<<elseif ($activeSlave.clothes is "a chattel habit")>>
She shucks her habit off easily, since it was designed to be removed quickly.
<<elseif ($activeSlave.clothes is "a penitent nuns habit")>>
She pulls her coarse habit over her head, revealing her chafed flesh.
<<elseif ($activeSlave.clothes is "cutoffs and a t-shirt")>>
She shimmies out of her cutoffs and whips her t-shirt over her head.
<<elseif ($activeSlave.clothes is "a slutty nurse outfit")>>
Getting out of her tight nurse getup in that amount of time is impossible, but she tries anyway.
<<elseif ($activeSlave.clothes is "a schoolgirl outfit")>>
Her schoolgirl outfit is easily stripped off: she pulls down her skimpy skirt and tears off her little blouse, and she's nude.
<<elseif ($activeSlave.clothes is "a kimono")>>
Getting out of her kimono in that amount of time is flagrantly impossible, but she tries anyway.
<<elseif ($activeSlave.clothes is "a hijab and abaya")>>
Because she's nude under her hijab and abaya, she simply lifts it over her head.
<<elseif ($activeSlave.clothes is "battledress")>>
She strips her tank top off in one motion, unfastens her belt, and pulls down her pants, though her boots defeat her and stay on.
<<elseif ($activeSlave.clothes is "a slutty outfit")>>
She hurriedly strips herself out of her carefully chosen outfit.
<<elseif ($activeSlave.clothes is "a slave gown")>>
She's desperately torn between hurry to avoid punishment and fear she'll rip her delicate gown.
<<elseif ($activeSlave.clothes is "a halter top dress")>>
She's desperately torn between hurry to avoid punishment and fear she'll rip her delicate dress.
<<elseif ($activeSlave.clothes is "a ball gown")>>
She's desperately torn between hurry to avoid punishment and fear she'll rip her delicate silken ball gown.
<<elseif ($activeSlave.clothes is "nice business attire")>>
She's desperately torn between hurry to avoid punishment and fear she'll damage her blouse.
<<elseif ($activeSlave.clothes is "slutty business attire")>>
She's desperately torn between hurry to avoid punishment and fear she'll tear her suit in her haste.
<<elseif ($activeSlave.clothes is "a nice maid outfit")>>
She pulls her dress over her head and quickly undoes the buttons of her blouse, one after the other.
<<elseif ($activeSlave.clothes is "a slutty maid outfit")>>
Her short dress comes off easily, but she fumbles with the buttons on her tight blouse.
<<elseif ($activeSlave.clothes is "a comfortable bodysuit")>>
She's desperately torn between hurry to avoid punishment and fear she'll stretch out her bodysuit.
<<elseif ($activeSlave.clothes is "a leotard")>>
Her leotard is tight enough that she has to struggle mightily to get it off that quickly.
<<elseif ($activeSlave.clothes is "a bunny outfit")>>
She's desperately torn between hurry to avoid punishment and fear she'll put runs in her hose.
<<elseif ($activeSlave.clothes is "harem gauze")>>
She's desperately torn between hurry to avoid punishment and fear she'll tear her flimsy gauze.
<<elseif ($activeSlave.clothes is "slutty jewelry")>>
She hurriedly strips fine jewelry from her neck, wrists, and ankles.
<<elseif ($activeSlave.bellyAccessory is "a corset")>>
Her fingers fumble desperately with the straps of her corset.
<<elseif ($activeSlave.bellyAccessory is "an extreme corset")>>
Her fingers fumble desperately with the bindings of her corset, and she hyperventilates within its embrace as she works.
<</if>>
<</if>>
<<if ($activeSlave.fetish is "masochist") && ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 60)>>
She seems to be a bit expectant of what is to come.
<<elseif ($activeSlave.fetish is "masochist") && ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 95)>>
The slap seems to have excited her, seeing her hard nipples and wet pussy, and her eyes practically beg for more.
<</if>>
<<if ($PC.dick == 1)>>
While she strips, your stiffening cock rises, revealing your pussy and earning
<<elseif $PC.vagina == 1>>
<<if ($activeSlave.amp isnot 1) and ($activeSlave.clothes isnot "no clothing")>>While she strips, you<<else>>You<</if>> don a cruelly large strap-on, earning
<<if ($activeSlave.fetish is "masochist") && ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 60)>>
a shy look
<<elseif ($activeSlave.fetish is "masochist") && ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 95)>>
a sultry look
<<else>>
a frightened glance
<</if>>
from your victim.
<</if>>
<<if ($activeSlave.amp == 1)>>
<<if ($activeSlave.clothes != "no clothing")>>Growing impatient, you rip the clothes off her limbless torso<<else>>You walk up to her<</if>> and spank her brutally; spinning her to present
<<if ($activeSlave.vagina > -1)>>
her holes
<<else>>
her hole
<</if>>
to you and
<<if ($activeSlave.fetish is "masochist") && ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 60)>>
<<if canAchieveErection($activeSlave)>>making her erect dick throb<<elseif $activeSlave.vagina > -1>>making her pussy throb<<else>>making her butthole throb<</if>>
<</if>>
with anticipation.
<<else>>
You order her to present <<if ($activeSlave.vagina > -1)>>her holes<<else>>her hole<</if>> to you and spank her brutally
<<if ($activeSlave.fetish is "masochist") && ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 60)>>
<<if canAchieveErection($activeSlave)>>making her erect dick throb<<elseif $activeSlave.vagina > -1>>making her pussy throb<<else>>making her butthole throb<</if>>
<</if>>
<<if $activeSlave.devotion lt -50>>
until she complies.
<<elseif $activeSlave.devotion < -20>>
as she slowly complies.
<<elseif $activeSlave.devotion <= 20>>
as she fearfully complies.
<<elseif $activeSlave.devotion <= 50>>
as she rushes to comply.
<<else>>
as she complies.
<</if>>
<</if>>
<<if $seeRace is 1>>
<<if $activeSlave.race is "white">>
Her white, $activeSlave.skin ass shows the spanking well.
<<elseif $activeSlave.race is "asian">>
Her asian, $activeSlave.skin ass shows the spanking well.
<<elseif $activeSlave.race is "middle eastern">>
Her arab, $activeSlave.skin ass barely shows the spanking.
<<elseif $activeSlave.race is "latina">>
Her latina, $activeSlave.skin ass barely shows the spanking.
<<elseif $activeSlave.race is "black">>
Her black, $activeSlave.skin ass barely shows any marks from the spanking.
<</if>>
<</if>>
<<if ($activeSlave.dickAccessory is "chastity")>>
You rip her dick chastity off her, though she knows not to be relieved. Her cock is now vulnerable, not free.
<</if>>
<<if ($activeSlave.anus is 0)>>
The bitch's still a butthole virgin and you don't mean to take that now, but you torture her with the threat of raping her virgin ass for a while before settling for her gagging throat
<<set $activeSlave.oralCount++, $oralTotal++>>
<<elseif ($activeSlave.vaginalAccessory is "chastity belt")>>
The bitch's wearing a chastity belt, so she isn't surprised when you shove <<if ($PC.dick is 0)>>the strap-on<<else>>your dick<</if>> up her butt. What surprises her is when you slide a finger or two in alongside your dick to stretch her to the point of pain
<<AnalVCheck>>
<<set _asspain to 1>>
<<elseif ($activeSlave.vagina is 0)>>
The bitch's still a virgin and you don't mean to take that now, but you torture her with the threat of raping her virgin pussy for a while before settling for her gagging throat
<<set $activeSlave.oralCount++, $oralTotal++>>
<<elseif ($activeSlave.preg > 30) and ($activeSlave.pregType >= 20)>>
The bitch is on the brink of bursting, so hard intercourse will be painful and terrifying to her. You thrust hard into her causing her taut belly to bulge and making her children squirm within her straining womb. You brutally fuck her as she pleads for you to stop until your at your edge. More cum won't make the bitch more pregnant, but you cum inside her anyway
<<VaginalVCheck>>
<<elseif ($activeSlave.preg > 30) and ($activeSlave.pregType >= 10)>>
The bitch is hugely pregnant, so hard intercourse will be uncomfortable and worrying for her. You have hard intercourse. She sobs as you rock the huge weight of her belly back and forth without mercy, forcing her already straining belly to bulge further, and whines as she feels your cockhead batter her womb. More cum won't make the bitch more pregnant, but you cum inside her anyway
<<VaginalVCheck>>
<<elseif ($activeSlave.preg > 10)>>
The bitch is pregnant, so hard intercourse will be uncomfortable and even worrying for her. You have hard intercourse. She sobs as you saw the huge weight of her belly back and forth without mercy, and whines as she feels your cockhead batter her womb.<<if ($PC.vagina == 1) && ($PC.dick == 1)>> Fortunately for her, this gets you so wet that some of your pussyjuice makes it down onto your shaft and serves as improvised lube.<</if>> More cum won't make the bitch more pregnant, but you cum inside her anyway
<<VaginalVCheck>>
<<elseif ($activeSlave.vagina is 1)>>
The bitch's pussy is tight, so you ram <<if ($PC.dick is 0)>>the strap-on<<else>>your dick<</if>> into her without preamble and fuck her hard and fast.<<if ($PC.vagina == 1) && ($PC.dick == 1)>> Fortunately for her, this gets you so wet that some of your pussyjuice makes it down onto your shaft and serves as improvised lube.<</if>> Her cunt spasms with the pain of the rape. You cum in no time
<<VaginalVCheck>>
<<elseif ($activeSlave.anus is 1)>>
The bitch's butt is tight, so you ram <<if ($PC.dick is 0)>>the strap-on<<else>>your dick<</if>> into her without lubricant and sodomize her as hard as you can without damaging your property.<<if ($PC.vagina == 1) && ($PC.dick == 1)>> Fortunately for her, this gets you so wet that some of your pussyjuice makes it down onto your shaft and serves as improvised lube.<</if>> Her asshole spasms with the pain of the rape. You cum explosively
<<AnalVCheck>>
<<set _asspain to 1>>
<<elseif ($activeSlave.dick gt 0) and ($activeSlave.balls gt 0)>>
You ram <<if ($PC.dick is 0)>>the strap-on<<else>>your dick<</if>> into her sissy butt without lubricant. As she flinches you announce that she'll be taking part in giving herself anal pain. She humps into you lamely, so you administer a truly agonizing slap to her balls<<if ($PC.dick is 0)>><<else>> that makes her anal ring stiffen deliciously around your dick<</if>>. To avoid further punishment she fucks herself against you almost hard enough to hurt herself.<<if ($PC.vagina == 1) && ($PC.dick == 1)>> Fortunately for her, this gets you so wet that some of your pussyjuice makes it down onto your shaft and serves as improvised lube.<</if>> You orgasm explosively
<<AnalVCheck>>
<<set _asspain to 1>>
<<elseif ($activeSlave.dick gt 0)>>
You ram your dick into her gelded butt without lubricant and sodomize her as hard as you can without damaging your property.<<if $PC.vagina == 1>> Fortunately for her, this gets you so wet that some of your pussyjuice makes it down onto your shaft and serves as improvised lube.<</if>> She's such a slut that she shows signs of enjoyment, but you put a stop to that whenever it happens by slapping and flicking her cock. You cum explosively
<<AnalVCheck>>
<<set _asspain to 1>>
<<else>>
She's got no special physical targets for abuse, so you just rape her hard and fast, raining stinging slaps down on her as you do. She cries and whimpers; you finish
<<BothVCheck>>
<</if>>.
<<if ($activeSlave.ID isnot $Bodyguard.ID)>>
This leaves her sobbing on the floor <<if ($PC.dick is 0)>>as you shuck off the strap-on and drop it on her face<<else>>with cum dripping out of her<</if>>.
<<elseif ($activeSlave.ID is $Bodyguard.ID) && ($activeSlave.fetish is "masochist") && ($activeSlave.fetishKnown == 1) && ($activeSlave.fetishStrength > 95)>>
She thanks you rapidly, trying to break away from the pleasure of your reward. She quickly gets back to her feet and stumbles towards the shower, to make sure you won't stay unprotected too long.
<<else>>
Even though she's in a somewhat bad shape, she still jumps back to her feet and stumbles towards the shower, to make sure you won't stay unprotected too long.
<</if>>
<<if ($activeSlave.ID isnot $Bodyguard.ID)>>
<<if $activeSlave.minorInjury is 0>>
<<if _asspain is 1>>
The anal rape leaves her with a sore butthole.
<<elseif random(1,100) gt 50>>
<<set $activeSlave.minorInjury to either("black eye", "split lip", "bruise")>>
Your abuse gave her a $activeSlave.minorInjury.
<</if>>
<</if>>
<</if>>
<<if ($activeSlave.preg > 30) and ($activeSlave.pregType >= 20)>>
The rough fucking was @@color:red;very unhealthy@@ for her huge pregnancy.
<<set $activeSlave.health -= 40>>
<</if>>
<<if ($activeSlave.ID is $Bodyguard.ID)>>
<<if ($activeSlave.muscles == 0) and ($activeSlave.combatSkill == 0)>>
Your bodyguard accepts this as a punishment for her uselesness.
<<elseif ($activeSlave.muscles == 0) and ($activeSlave.combatSkill != 0)>>
Your bodyguard accepts this as a punishment for her lack of muscles
<<elseif ($activeSlave.muscles != 0) and ($activeSlave.combatSkill == 0)>>
Your bodyguard accepts this as a punishment for her lack of combat skills
<<elseif ($activeSlave.muscles != 0) and ($activeSlave.combatSkill != 0)>>
Your bodyguard just admits it as a part of her body training.
<</if>>
<<if ($activeSlave.fetish is "masochist") and ($activeSlave.fetishStrength > 60) and ($activeSlave.fetishKnown == 1)>>
Though she secretly got off on the pain and humiliation.
<</if>>
<<elseif ($activeSlave.fetish is "masochist") and ($activeSlave.fetishStrength > 60) and ($activeSlave.fetishKnown == 1)>>
She secretly got off on the pain and humiliation.
<<elseif $arcologies[0].FSDegradationist != "unset">>
She knew that a degradationist arcology wouldn't be easy on her, so even if she resents it, she tries to accept it.
<<elseif $activeSlave.devotion lt -50>>
Her @@color:mediumorchid;hatred@@ and @@color:gold;fear@@ of you have increased.
<<set $activeSlave.devotion-=4, $activeSlave.trust-=4>>
<<elseif $activeSlave.devotion < -20>>
Her @@color:mediumorchid;resistance@@ to and @@color:gold;fear@@ of you have increased.
<<set $activeSlave.devotion-=4, $activeSlave.trust-=4>>
<<elseif $activeSlave.devotion <= 20>>
Her @@color:gold;fear@@ of you is tinged with @@color:mediumorchid;hatred.@@
<<set $activeSlave.devotion-=4, $activeSlave.trust-=4>>
<<elseif $activeSlave.devotion <= 50>>
Her @@color:mediumorchid;obedience to you is reduced,@@ and she @@color:gold;fears@@ further abuse.
<<set $activeSlave.devotion-=4, $activeSlave.trust-=4>>
<<else>>
She is so devoted to you that she accepts your abuse as her just due, but she now @@color:gold;fears@@ you more and trusts you less.
<<set $activeSlave.trust-=4>>
<</if>>
<<if (random(1,100) > (20+$activeSlave.devotion+$activeSlave.trust))>>
<<if ($activeSlave.fetish isnot "submissive") and ($activeSlave.fetish isnot "masochist") and ($activeSlave.ID != $Bodyguard.ID)>>
<<set _seed to random(1,8)>>
Brutal abuse has left her
<<if (_seed is 1) and ($activeSlave.behavioralFlaw isnot "odd")>>
@@color:red;acting strangely.@@
<<set $activeSlave.behavioralFlaw to "odd">>
<<elseif (_seed is 2) and ($activeSlave.behavioralFlaw isnot "anorexic")>>
@@color:red;starving herself@@ in a crippling attempt to be pretty.
<<set $activeSlave.behavioralFlaw to "anorexic">>
<<elseif (_seed is 3) and ($activeSlave.behavioralFlaw isnot "gluttonous")>>
@@color:red;stress eating@@ whenever she can.
<<set $activeSlave.behavioralFlaw to "gluttonous">>
<<elseif (_seed is 4) and ($activeSlave.behavioralFlaw isnot "devout")>>
@@color:red;praying in private@@ whenever she can.
<<set $activeSlave.behavioralFlaw to "devout">>
<<elseif (_seed is 5) and ($activeSlave.sexualFlaw isnot "apathetic")>>
@@color:red;sexually apathetic,@@ since she feels it cannot go well for her.
<<set $activeSlave.sexualFlaw to "apathetic">>
<<elseif (_seed is 6) and ($activeSlave.sexualFlaw isnot "crude")>>
@@color:red;sexually crude,@@ out of an unconscious belief that sex is ugly and unworthy of effort.
<<set $activeSlave.sexualFlaw to "crude">>
<<elseif (_seed is 7) and ($activeSlave.sexualFlaw isnot "judgemental")>>
@@color:red;sexually judgemental,@@ out of an unconscious desire to disqualify people from being good enough to have sex with her.
<<set $activeSlave.sexualFlaw to "judgemental">>
<<elseif ($PC.dick is 1)>>
@@color:red;hating men,@@ since you forced your cock on her.
<<set $activeSlave.behavioralFlaw to "hates men">>
<<else>>
@@color:red;hating women,@@ since you forced your cunt on her.
<<set $activeSlave.behavioralFlaw to "hates women">>
<</if>>
<</if>>
<</if>>
<<if (random(1,100) gt (50+$activeSlave.devotion+$activeSlave.trust)) && ($activeSlave.ID isnot $Bodyguard.ID)>>
<<if ($activeSlave.fetish isnot "mindbroken") and ($activeSlave.fetishKnown is 0) and ($activeSlave.clitSetting isnot $activeSlave.fetish)>>
Her acceptance of your abuse has twisted her
<<if (random(1,2) is 1) and ($activeSlave.fetish isnot "submissive")>>
@@color:lightcoral;sexuality towards submissiveness.@@
<<set $activeSlave.fetish to "submissive", $activeSlave.fetishKnown to 1>>
<<elseif ($activeSlave.fetish isnot "masochism")>>
@@color:lightcoral;sexuality towards masochism.@@
<<set $activeSlave.fetish to "masochism", $activeSlave.fetishKnown to 1>>
<</if>>
<</if>>
<</if>>
<<if passage() isnot "Slave Interact">>
<<for _i to 0; _i lt $slaves.length; _i++>>
<<if $slaves[_i].ID is $activeSlave.ID>>
<<set $slaves[_i] to $activeSlave>>
<<break>>
<</if>>
<</for>>
<</if>>
<</nobr>>\
|
r3d/fc
|
src/npc/fAbuse.tw
|
tw
|
bsd-3-clause
| 24,747
|
:: FPCImpreg
<<nobr>>
<<if $activeSlave.mpreg == 1>>
<<set $activeSlave.analCount += 1>>
<<set $analTotal += 1>>
<<else>>
<<set $activeSlave.vaginalCount += 1>>
<<set $vaginalTotal += 1>>
<</if>>
You call her over so you can
<<if $activeSlave.mpreg == 1>>
<<if ($activeSlave.anus > 2)>>
fuck her gaping, fertile asshole.
<<elseif ($activeSlave.anus is 2)>>
use her whorish, fertile asshole.
<<elseif ($activeSlave.anus == 1)>>
use her tight, fertile asshole.
<<elseif ($activeSlave.anus == 0)>>
take her fertile, virgin asshole.
<</if>>
<<else>>
<<if ($activeSlave.vagina > 2)>>
fuck her gaping, fertile cunt.
<<elseif ($activeSlave.vagina is 2)>>
use her whorish, fertile cunt.
<<elseif ($activeSlave.vagina == 1)>>
use her tight, fertile cunt.
<<elseif ($activeSlave.vagina == 0)>>
take her fertile, virgin pussy.
<</if>>
<<if ($activeSlave.vaginaTat is "tribal patterns")>>
The tattoos on her abdomen certainly draw attention there.
<<elseif ($activeSlave.vaginaTat is "scenes")>>
The tattoos on her abdomen nicely illustrate what you mean to do to her.
<<elseif ($activeSlave.vaginaTat is "degradation")>>
The tattoos on her abdomen ask you to, after all.
<</if>>
<<if $activeSlave.clit == 1>>
Her big clit peeks out from under its hood.
<<elseif $activeSlave.clit > 2>>
Her huge clit is impossible to miss.
<</if>>
<<if ($activeSlave.vaginaPiercing > 1) && ($activeSlave.vagina != -1)>>
Her pierced lips and clit have her nice and wet.
<<elseif ($activeSlave.vaginaPiercing == 1) && ($activeSlave.vagina != -1)>>
Her pierced clit has her nice and moist.
<</if>>
<</if>>
<<if ($activeSlave.fetish is "pregnancy") && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetishKnown == 1) && ($activeSlave.vagina == 0)>>
She cries with joy and presents her virgin <<if $activeSlave.mpreg == 1>>asshole<<else>>pussy<</if>> for fertilization. She sobs with happiness when she feels your hot seed, knowing that her first time will always be special to her. She spends the rest of the day cherishing her stomach. This new connection with <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>her master<<else>>her mistress<</if>> @@color:hotpink;increases her devotion to you.@@ @@color:lime;Her <<if $activeSlave.mpreg == 1>>asshole<<else>>pussy<</if>> has been broken in, and there's a good chance she's pregnant.@@
<<if $activeSlave.mpreg == 1>>
<<set $activeSlave.anus to 1>>
<<else>>
<<set $activeSlave.vagina to 1>>
<</if>>
<<set $activeSlave.devotion += 15>>
<<elseif ($activeSlave.fetish is "pregnancy") && ($activeSlave.fetishStrength > 60) && ($activeSlave.fetishKnown == 1)>>
She cries with joy and presents her fertile <<if $activeSlave.mpreg == 1>>asshole<<else>>pussy<</if>> for breeding. She sobs with happiness when she feels your hot seed. She spends the rest of the day considering her own stomach with pride. This new connection with <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>her master<<else>>her mistress<</if>> @@color:hotpink;increases her devotion to you.@@
<<set $activeSlave.devotion += 10>>
<<elseif ($activeSlave.devotion > 20) && ($activeSlave.vagina == 0)>>
She accepts your orders without comment and presents her virgin <<if $activeSlave.mpreg == 1>>asshole<<else>>pussy<</if>> for fertilization. She gasps in shock when she feels your hot seed. She spends the rest of the day struggling with roiling emotions. Since she is already well broken, this new connection with <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>her master<<else>>her mistress<</if>> @@color:hotpink;increases her devotion to you.@@ @@color:lime;Her <<if $activeSlave.mpreg == 1>>asshole<<else>>pussy<</if>> has been broken in, and there's a good chance she's pregnant.@@
<<if $activeSlave.mpreg == 1>>
<<set $activeSlave.anus to 1>>
<<else>>
<<set $activeSlave.vagina to 1>>
<</if>>
<<set $activeSlave.devotion += 10>>
<<elseif ($activeSlave.devotion >= -20) && ($activeSlave.vagina == 0)>>
She is clearly unhappy at losing her pearl of great price to you; this probably isn't what she imagined her first real sex would be like. Worse, she knows she's fertile and realizes she'll likely get pregnant. Nevertheless, this new connection with <<if def $PC.customTitle>>$PC.customTitle<<elseif $PC.title != 0>>her master<<else>>her mistress<</if>> @@color:hotpink;increases her devotion to you.@@ @@color:lime;Her <<if $activeSlave.mpreg == 1>>asshole<<else>>pussy<</if>> has been broken in.@@
<<if $activeSlave.mpreg == 1>>
<<set $activeSlave.anus to 1>>
<<else>>
<<set $activeSlave.vagina to 1>>
<</if>>
<<set $activeSlave.devotion += 4>>
<<elseif ($activeSlave.vagina == 0)>>
As you anticipated, she refuses to give you her virginity. And as you expected, she is unable to resist you. She cries as your cock opens her fresh, tight hole. Afterward, she clutches her stomach and sobs, horrified by the knowledge that she's probably carrying her rapist's child. The rape @@color:mediumorchid;decreases her devotion to you@@ and @@color:gold;fills her with fear.@@ @@color:lime;Her <<if $activeSlave.mpreg == 1>>asshole<<else>>pussy<</if>> has been broken in.@@
<<set $activeSlave.devotion -= 5>>
<<set $activeSlave.trust -= 5>>
<<if $activeSlave.mpreg == 1>>
<<set $activeSlave.anus to 1>>
<<else>>
<<set $activeSlave.vagina to 1>>
<</if>>
<<elseif ($activeSlave.amp == 1)>>
You set her limbless torso on the end of the couch, face down, with her hips up in the air. This way, you get the greatest degree of penetration into her fertile <<if $activeSlave.mpreg == 1>>ass<<else>>pussy<</if>> you can manage. She moans into the cushions, knowing that with the hot flow of semen against her innermost recesses, she has probably gotten pregnant.
<<elseif tooBigBreasts($activeSlave)>>
You set her down on the couch, face down, with her hips up in the air. This way, she's pinned in place by the weight of her ridiculous tits, and you get the greatest degree of penetration into her fertile <<if $activeSlave.mpreg == 1>>ass<<else>>pussy<</if>>. She moans into the cushions, knowing that with the hot flow of semen against her innermost recesses, she has probably gotten pregnant.
<<elseif tooBigButt($activeSlave)>>
You set her down on the couch, face down, with her hips up in the air. This way, she's stuck under her ridiculous ass, you get an amazingly soft rear to pound, and you get the greatest degree of penetration into her fertile <<if $activeSlave.mpreg == 1>>ass<<else>>pussy<</if>>. She moans into the cushions, knowing that with the hot flow of semen against her innermost recesses, she has probably gotten pregnant.
<<elseif tooBigDick($activeSlave)>>
You set her down on the couch, face down, with her hips up in the air. This way, she's anchored in place by the weight of her ridiculous cock, and you get the greatest degree of penetration into her fertile <<if $activeSlave.mpreg == 1>>ass<<else>>pussy<</if>>. She moans into the cushions, knowing that with the hot flow of semen against her innermost recesses, she has probably gotten pregnant.
<<elseif tooBigBalls($activeSlave)>>
You set her down on the couch, face down, with her hips up in the air. This way, she's anchored in place by the weight of her ridiculous balls, and you get the greatest degree of penetration into her fertile <<if $activeSlave.mpreg == 1>>ass<<else>>pussy<</if>>. She moans into the cushions, knowing that with the hot flow of semen against her innermost recesses, she has probably gotten pregnant.
<<elseif ($activeSlave.fetish is "submissive") and ($activeSlave.fetishStrength > 60) and ($activeSlave.fetishKnown == 1)>>
She comes submissively over, smiling a little submissive smile, and spreads herself for you. You take her on the couch next to your desk in the missionary position. She hugs her torso to you and her breasts press against your chest; you can feel her heart beating hard. As the sex reaches its climax, she begs you to use her unworthy body to make a new slave.
<<elseif $activeSlave.devotion < -20>>
She tries to refuse, so you bend the disobedient slave over your desk and take her hard from behind. Her breasts slide back and forth across the desk. You give her buttocks some nice hard swats as you pound her. She grunts and moans but knows better than to try to get away. She begs you not to cum inside her, knowing she's fertile, and sobs when she feels you fill her with semen despite her pleas.
<<elseif $activeSlave.devotion <= 20>>
She obeys, lying on the couch next to your desk with her legs spread. You kneel on the ground and enter her, a hand on each of her legs to give you purchase. The pounding is hard and fast, and she gasps and whines. You reach a hand down to maul her breasts. She begs you not to cum inside her, knowing she's fertile, but soon loses track of her fears as she enjoys herself. She bites her lip and moans as she climaxes. You fill her squeezing fuckhole with your cum; she realizes what you've done with a gasp and a worried look.
<<else>>
She skips over smiling and gives you a quick kiss. You take her on the couch next to your desk in the missionary position. She hugs her torso to you and her breasts press against your chest; you can feel her heart beating hard. As the sex reaches its climax, her kisses grow urgent and passionate. She clings to you as she rides the downslope of her orgasm. She kisses you and promises to do her best to use her womb to make a good slave for you.
<</if>>
You repeat this ritual throughout the week, ensuring that $activeSlave.slaveName is carrying your child.
<<if random(1,100) >= 1>>
<<set $activeSlave.preg to 1>>
<<if ($activeSlave.drugs is "super fertility drugs")>>
<<if (($masterSuitePregnancyFertilitySupplements == 1) && (($activeSlave.assignment is "serve in the master suite") || ($activeSlave.ID is $Concubine.ID)))>>
<<if ($activeSlave.hormones == 2)>>
<<set $activeSlave.pregType to random(20,29)>>
<<else>>
<<set $activeSlave.pregType to random(10,29)>>
<</if>>
<<else>>
<<if ($activeSlave.hormones == 2)>>
<<set $activeSlave.pregType to random(10,29)>>
<<else>>
<<set $activeSlave.pregType to either(3, 4, 4, 4, 5, 5, 5, 10, 10, 20)>>
<</if>>
<</if>>
<<elseif ($activeSlave.drugs is "fertility drugs")>>
<<if (($masterSuitePregnancyFertilitySupplements == 1) && (($activeSlave.assignment is "serve in the master suite") || ($activeSlave.ID is $Concubine.ID)))>>
<<if ($activeSlave.hormones == 2)>>
<<set $activeSlave.pregType to random(4,5)>>
<<else>>
<<set $activeSlave.pregType to either(2, 2, 3, 3, 3, 3, 4, 4, 5, 5)>>
<</if>>
<<else>>
<<if ($activeSlave.hormones == 2)>>
<<set $activeSlave.pregType to random(2,5)>>
<<else>>
<<set $activeSlave.pregType to either(1, 1, 2, 2, 3, 3, 4, 4, 5, 5)>>
<</if>>
<</if>>
<<else>>
<<set $activeSlave.pregType to either(1, 1, 1, 1, 1, 1, 1, 1, 1, 2)>>
<</if>>
<<set $activeSlave.pregSource to -1>>
<</if>>
<<if $arcologies[0].FSRestart != "unset">>
<<if $activeSlave.breedingMark != 1>>
Rumors spread about you fucking your slaves pregnant; the Societal Elite are @@color:red; very displeased@@ by these rumors.
<<set $failedElite += 5>>
<</if>>
<</if>>
<<if $arcologies[0].FSGenderRadicalist != "unset" && $activeSlave.mpreg == 1>>
Society @@color:green;approves@@ of your fucking your slaves ass pregnant; this advances the ideal all a slave needs is her rear.
<<set $rep += $FSSingleSlaveRep*($arcologies[0].FSGenderRadicalist/$FSLockinLevel)>>
<<set $arcologies[0].FSGenderRadicalist += 0.05*$FSSingleSlaveRep>>
<<elseif $arcologies[0].FSGenderFundamentalist != "unset" && $activeSlave.mpreg == 1>>
Society @@color:red;is disgusted@@ by this degenerate form of reproduction.
<<set $rep -= $FSSingleSlaveRep*($arcologies[0].FSGenderFundamentalist/$FSLockinLevel)>>
<<set $arcologies[0].FSGenderFundamentalist -= 0.05*$FSSingleSlaveRep>>
<<elseif $arcologies[0].FSGenderFundamentalist != "unset">>
Society @@color:green;approves@@ of your putting a new slave in her; this advances the idea that all slaves should bear their masters' babies.
<<set $rep += $FSSingleSlaveRep*($arcologies[0].FSGenderFundamentalist/$FSLockinLevel)>>
<<set $arcologies[0].FSGenderFundamentalist += 0.05*$FSSingleSlaveRep>>
<</if>>
<</nobr>>
|
r3d/fc
|
src/npc/fPCImpreg.tw
|
tw
|
bsd-3-clause
| 12,312
|
:: FRival
<<nobr>>
<<for _i to 0; _i lt $slaves.length; _i++>>
<<if $slaves[_i].ID == $activeSlave.rivalryTarget>>
<<set _rival to $slaves[_i]>>
<<break>>
<</if>>
<</for>>
You call $activeSlave.slaveName to your office and let her know you'll be abusing _rival.slaveName together.
<<if ($activeSlave.fetish is "sadist") and ($activeSlave.fetishStrength > 60) and ($activeSlave.fetishKnown is 1)>>
She looks overjoyed at the prospect of getting to hurt someone.
<</if>>
_rival.slaveName sees $activeSlave.slaveName as she enters and looks worried.
<<if (_rival.anus is 0) and (_rival.vagina lt 0)>>
Since she's a sissy bitch and an anal virgin, you tell her to bend over and <<if ($PC.dick is 0)>>give you head<<else>>suck your dick<</if>>. She does, and once she's working away, you tell $activeSlave.slaveName to come over and start spanking. _rival.slaveName begins to lift her head as though to protest, so you shove her back down onto your <<if ($PC.dick is 0)>>pussy<<else>>cock<</if>>, gagging and struggling. $activeSlave.slaveName administers a series of cruel slaps to the quivering <<if $seeRace is 1>>_rival.race <</if>>buttocks in front of her, making your victim yell delightfully into your <<if ($PC.dick is 0)>>womanhood<<else>>member<</if>>. After a short time $activeSlave.slaveName decides to be even crueler, and begins to 'miss' frequently, hitting _rival.slaveName's limp dick instead of her ass.
<<set _rival.oralCount++, $oralTotal++>>
<<elseif (_rival.anus is 0) and (_rival.vagina is 0)>>
Since she's a virgin, you tell her to bend over and <<if ($PC.dick is 0)>>give you head<<else>>suck your dick<</if>>. She does, and once she's working away, you tell $activeSlave.slaveName to come over and start spanking. _rival.slaveName begins to lift her head as though to protest, so you shove her back down onto your <<if ($PC.dick is 0)>>pussy<<else>>cock<</if>>, gagging and struggling. $activeSlave.slaveName administers a series of cruel slaps to the quivering <<if $seeRace is 1>>_rival.race <</if>>buttocks in front of her, making your victim yell delightfully into your <<if ($PC.dick is 0)>>womanhood<<else>>member<</if>>. After a short time $activeSlave.slaveName decides to be even crueler, and begins to 'miss' frequently, hitting _rival.slaveName's poor pussy instead of her ass.
<<set _rival.oralCount++, $oralTotal++>>
<<elseif (_rival.anus is 0) and (_rival.vagina gt 0) and ($activeSlave.dick gt 0) and ($activeSlave.balls gt 0) and ($activeSlave.hormones lt 1) and ($activeSlave.dickAccessory isnot "chastity")>>
You tell her to bend over and <<if ($PC.dick is 0)>>give you head<<else>>suck your dick<</if>>. She does, and once she's working away, you tell $activeSlave.slaveName to use the bitch. _rival.slaveName begins to lift her head as though to protest, so you shove her back down onto your <<if ($PC.dick is 0)>>pussy<<else>>cock<</if>>, gagging and struggling. $activeSlave.slaveName lands a slap on the <<if $seeRace is 1>>_rival.race <</if>>butt in front of her as she lines her turgid dick up with _rival.slaveName's pussy. She sinks in with a sigh and begins to enjoy herself, using slaps and pinches to ensure that of the two slaves, the fun is entirely on her side.
<<set _rival.vaginalCount++, _rival.oralCount++, $activeSlave.penetrativeCount++, $vaginalTotal++, $oralTotal++, $penetrativeTotal++>>
<<elseif (_rival.anus is 0) and (_rival.vagina gt 0) and ($activeSlave.dick gt 0)>>
You <<if ($PC.dick is 0)>>step into a strap-on and tell her to ride it<<else>>tell her to ride your dick<</if>>, facing away from you. She does, not without trepidation, which increases when you hold her securely in place. Once she's humping away, you tell $activeSlave.slaveName to use her face. $activeSlave.slaveName comes over slowly, unsure what to do with the offer since her dick is so useless. She forces _rival.slaveName's face against her useless member anyway. After a bit of this, $activeSlave.slaveName, clearly unsatisfied, turns around and rides _rival.slaveName with her ass instead. _rival.slaveName tries to avoid orally servicing her rival's asshole, but you hold her in place and $activeSlave.slaveName sighs in contentment.
<<set _rival.oralCount++, _rival.vaginalCount++, $activeSlave.oralCount++, $vaginalTotal++, $oralTotal += 2>>
<<elseif (_rival.anus is 0) and (_rival.vagina gt 0)>>
You <<if ($PC.dick is 0)>>step into a strap-on and tell her to ride it<<else>>tell her to ride your dick<</if>>, facing away from you. She does, not without trepidation, which increases when you hold her securely in place. Once she's humping away, you tell $activeSlave.slaveName to ride her face. $activeSlave.slaveName comes over, gently rubbing her pussy. She forces _rival.slaveName's face against her slick cunt, ignoring her reluctance. _rival.slaveName eventually realizes that she's better off getting it over with, and applies her tongue as best she can.
<<set _rival.oralCount++, _rival.vaginalCount++, $activeSlave.oralCount++, $vaginalTotal++, $oralTotal += 2>>
<<elseif (_rival.anus gt 0) and (_rival.vagina lt 0) and ($activeSlave.dick gt 0) and ($activeSlave.balls gt 0) and ($activeSlave.hormones lt 1) and $activeSlave.dickAccessory isnot ("chastity")>>
You <<if ($PC.dick is 0)>>step into a strap-on and tell her to ride it<<else>>tell her to ride your dick<</if>>, facing you. She lowers her butthole down onto your cock, not without trepidation, which increases when you reach behind her and spread her buttocks as wide as they'll go. With her pinned, you tell $activeSlave.slaveName to come over and join you. $activeSlave.slaveName comes over, stroking herself hard, not certain what you mean. To make it clear, you hook a single finger up into poor _rival.slaveName's rectum alongside <<if ($PC.dick is 0)>>the fake phallus<<else>>your dick<</if>>. It takes $activeSlave.slaveName a while to jam her cock up the struggling and sobbing _rival.slaveName's anus. Of the three phalli present, _rival.slaveName's is the only one that's soft as she cries her way through a brutal double anal rape.
<<set _rival.analCount++, $activeSlave.penetrativeCount++, $analTotal++, $penetrativeTotal++>>
<<elseif (_rival.anus gt 0) and (_rival.vagina is 0) and ($activeSlave.dick gt 0) and ($activeSlave.balls gt 0) and ($activeSlave.hormones lt 1) and $activeSlave.dickAccessory isnot ("chastity")>>
You <<if ($PC.dick is 0)>>step into a strap-on and tell her to ride it<<else>>tell her to ride your dick<</if>> anally, facing you. She lowers her butthole down onto your cock, not without trepidation, which increases when you reach behind her and spread her buttocks as wide as they'll go. With her pinned, you tell $activeSlave.slaveName to come over and join you. $activeSlave.slaveName comes over, stroking herself hard, not certain what you mean. To make it clear, you hook a single finger up into poor _rival.slaveName's rectum alongside <<if ($PC.dick is 0)>>the fake phallus<<else>>your dick<</if>>. It takes $activeSlave.slaveName a while to jam her cock up the struggling and sobbing _rival.slaveName's anus. _rival.slaveName buys continued vaginal virginity by taking a brutal double anal rape.
<<set _rival.analCount++, $activeSlave.penetrativeCount++, $analTotal++, $penetrativeTotal++>>
<<elseif (_rival.anus gt 0) and (_rival.vagina lt 1) and ($activeSlave.dick gt 0)>>
You <<if ($PC.dick is 0)>>step into a strap-on and tell her to ride it<<else>>tell her to ride your dick<</if>> anally, facing away from you. She does, not without trepidation, which increases when you hold her securely in place as you pump yourself in and out of her asshole. You tell $activeSlave.slaveName to ride her face. $activeSlave.slaveName comes over slowly, unsure what to do with the offer since her dick is so useless. She forces _rival.slaveName's face against her useless member anyway. After a bit of this, $activeSlave.slaveName, clearly unsatisfied, turns around and rides _rival.slaveName with her ass instead. _rival.slaveName tries to avoid orally servicing her rival's asshole, but you hold her in place and $activeSlave.slaveName sighs in contentment.
<<set _rival.analCount++, _rival.oralCount++, $activeSlave.oralCount++, $analTotal++, $oralTotal += 2>>
<<elseif (_rival.anus gt 0) and (_rival.vagina lt 1)>>
You <<if ($PC.dick is 0)>>step into a strap-on and tell her to ride it<<else>>tell her to ride your dick<</if>> anally, facing away from you. She does, not without trepidation, which increases when you hold her securely in place as you pump yourself in and out of her asshole. You tell $activeSlave.slaveName to ride her face. $activeSlave.slaveName comes over, gently rubbing her pussy. She forces _rival.slaveName's face against her slick cunt, ignoring her reluctance. _rival.slaveName eventually realizes that she's better off getting it over with, and applies her tongue as best she can.
<<set _rival.oralCount++, _rival.analCount++, $activeSlave.oralCount++, $analTotal++, $oralTotal += 2>>
<<elseif (_rival.anus gt 0) and (_rival.vagina gt 0) and ($activeSlave.dick gt 0) and ($activeSlave.balls gt 0) and ($activeSlave.hormones lt 1) and $activeSlave.dickAccessory isnot ("chastity")>>
You <<if ($PC.dick is 0)>>step into a strap-on and tell her to ride it<<else>>tell her to ride your dick<</if>>, facing you. She does, with some trepidation, which increases when you reach behind her and spread her buttocks as wide as they'll go. With her pinned, you tell $activeSlave.slaveName to come over and join you. $activeSlave.slaveName comes over, stroking herself hard. You squeeze _rival.slaveName's buttocks together and then spread them again, forcing her anus to wink invitingly. You stop _rival.slaveName's abortive humping and hold her hips in place while $activeSlave.slaveName gets her cock up her ass. Once she's set, off the two of you go, with poor _rival.slaveName gasping and grimacing as she gets it rough in both holes.
<<set _rival.vaginalCount++, _rival.analCount++, $activeSlave.penetrativeCount++, $vaginalTotal++, $analTotal++, $penetrativeTotal++>>
<<elseif (_rival.anus gt 0) and (_rival.vagina gt 0) and ($activeSlave.dick gt 0)>>
You <<if ($PC.dick is 0)>>step into a strap-on and tell her to ride it<<else>>tell her to ride your dick<</if>>, facing you. She does, with some trepidation, which increases when you reach behind her and spread her buttocks as wide as they'll go. With her pinned, you tell $activeSlave.slaveName to come over and join you. $activeSlave.slaveName comes over, stroking herself hard, not certain what you mean, since her cock is useless. To make it clear, you push two fingers into _rival.slaveName's butt, finger fucking her asshole until $activeSlave.slaveName takes over. Once she's set, off the two of you go, with poor _rival.slaveName gasping and grimacing as she gets it rough in both holes. $activeSlave.slaveName uses as many fingers as she can, always at least one more than _rival.slaveName would like.
<<set _rival.vaginalCount++, _rival.analCount++, $activeSlave.penetrativeCount++, $vaginalTotal++, $analTotal++, $penetrativeTotal++>>
<<elseif (_rival.anus gt 0) and (_rival.vagina gt 0)>>
You <<if ($PC.dick is 0)>>step into a strap-on and tell her to ride it<<else>>tell her to ride your dick<</if>>, facing you. She does, with some trepidation, which increases when you reach behind her and spread her buttocks as wide as they'll go. With her pinned, you tell $activeSlave.slaveName to come over and join you, indicating a strap-on for slave use, on a side shelf. $activeSlave.slaveName hurries into it and comes over. You stop _rival.slaveName's abortive humping and hold her hips in place while $activeSlave.slaveName gets her fake cock up her ass. Once she's set, off the two of you go, with poor _rival.slaveName gasping and grimacing as she gets it rough in both holes. $activeSlave.slaveName murmurs calumnies in _rival.slaveName's ear, pinches her nipples, and generally adds humiliation above and beyond being double penetrated by her owner and her rival.
<<set _rival.vaginalCount++, _rival.analCount++, $activeSlave.penetrativeCount++, $vaginalTotal++, $analTotal++, $penetrativeTotal++>>
<<else>>
Unforeseen combination of rival stats; yell at FC Dev to write a scene for these slaves.
<</if>>
<<if $slaves[_i].ID == _rival.ID>>
<<set $slaves[_i] to _rival>>
<<else>>
<<for _i to 0; _i lt $slaves.length; _i++>>
<<if $slaves[_i].ID == _rival.ID>>
<<set $slaves[_i] to _rival>>
<<break>>
<</if>>
<</for>>
<</if>>
<<if passage() isnot "Slave Interact">>
<<for _i to 0; _i lt $slaves.length; _i++>>
<<if $slaves[_i].ID == $activeSlave.ID>>
<<set $slaves[_i] to $activeSlave>>
<<break>>
<</if>>
<</for>>
<</if>>
<<set _rival to null>>
<</nobr>>\
|
r3d/fc
|
src/npc/fRival.tw
|
tw
|
bsd-3-clause
| 12,764
|
:: FSlaveImpreg
<<nobr>>
<<set $nextButton to "Back">>
<<set $nextLink to "Slave Interact">>
<<set $impregnatrix to 0>>
<<set $eligibility to 0>>
//$activeSlave.slaveName is fertile; now you must select a slave with both a penis and potent testicles.//
<</nobr>>
__Select an eligible slave to serve as the semen donatrix:__
<<for $i to 0; $i < $slaves.length; $i++>>\
<<if ($slaves[$i].dick > 0)>>\
<<if ($slaves[$i].balls > 0)>>\
<<if ($slaves[$i].pubertyXY == 1)>>\
<<if canBreed($activeSlave, $slaves[$i])>>\
<<if ($slaves[$i].dickAccessory != "chastity")>>\
<<if ($slaves[$i].ID != $activeSlave.ID)>>\
<<print "[[$slaves[$i].slaveName|FSlaveImpreg Consummate][$impregnatrix to $slaves[" + $i + "]]]">>
<<set $eligibility to 1>>\
<</if>>\
<</if>>\
<</if>>\
<</if>>\
<</if>>\
<</if>>\
<</for>>\
<<if ($eligibility == 0)>>\
//You have no slaves capable of inseminating others.//
<</if>>\
|
r3d/fc
|
src/npc/fSlaveImpreg.tw
|
tw
|
bsd-3-clause
| 913
|
:: Fucktoy Workaround
<<set $activeSlave.assignment to "please you">>
<<set $activeSlave.choosesOwnAssignment to 0>>
<<for $i to 0; $i < $slaves.length; $i++>>
<<if $activeSlave.ID == $slaves[$i].ID>>
<<set $slaves[$i] to $activeSlave>>
<<break>>
<</if>>
<</for>>
<<goto "Main">>
|
r3d/fc
|
src/npc/fucktoyWorkaround.tw
|
tw
|
bsd-3-clause
| 287
|